pop_keyboard_mode should return True when nothing is done

This commit is contained in:
Kovid Goyal 2023-12-03 19:07:15 +05:30
parent cc5424c054
commit ca6c607148
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -1340,12 +1340,13 @@ class Boss:
End the current keyboard mode switching to the previous mode.
''')
def pop_keyboard_mode(self) -> bool:
passthrough = True
if self.keyboard_mode_stack:
self.keyboard_mode_stack.pop()
if not self.keyboard_mode_stack:
set_ignore_os_keyboard_processing(False)
return True
return False
passthrough = False
return passthrough
@ac('misc', '''
Switch to the specified keyboard mode, pushing it onto the stack of keyboard modes.
@ -1368,7 +1369,7 @@ class Boss:
return False
if self.global_shortcuts_map and get_shortcut(self.global_shortcuts_map, ev):
return True
if self.pop_keyboard_mode():
if not self.pop_keyboard_mode():
if get_options().enable_audio_bell:
ring_bell()
return True