mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 16:58:09 +02:00
A single multi-key mapping should not prematurely complete as that confuses people trying out the feature
See #7073
This commit is contained in:
@@ -175,7 +175,7 @@ class Mappings:
|
|||||||
self._push_keyboard_mode(sm)
|
self._push_keyboard_mode(sm)
|
||||||
self.debug_print('\n\x1b[35mKeyPress\x1b[m matched sequence prefix, ', end='')
|
self.debug_print('\n\x1b[35mKeyPress\x1b[m matched sequence prefix, ', end='')
|
||||||
else:
|
else:
|
||||||
if len(final_actions) == 1:
|
if len(final_actions) == 1 and not final_actions[0].rest:
|
||||||
self.pop_keyboard_mode()
|
self.pop_keyboard_mode()
|
||||||
consumed = self.combine(final_actions[0].definition)
|
consumed = self.combine(final_actions[0].definition)
|
||||||
if not consumed:
|
if not consumed:
|
||||||
|
|||||||
@@ -610,6 +610,11 @@ class TestKeys(BaseTest):
|
|||||||
af(tm.actions)
|
af(tm.actions)
|
||||||
self.ae(len(tm.active_window.key_seqs), 1)
|
self.ae(len(tm.active_window.key_seqs), 1)
|
||||||
|
|
||||||
|
# a single multi-key mapping should not prematurely match
|
||||||
|
tm = TM('map alt+1>2>3')
|
||||||
|
self.ae(tm('alt+1', '2'), [True, True])
|
||||||
|
af(tm.actions)
|
||||||
|
|
||||||
# changing a multi key mapping
|
# changing a multi key mapping
|
||||||
tm = TM('map kitty_mod+p>f new_window')
|
tm = TM('map kitty_mod+p>f new_window')
|
||||||
self.ae(tm('ctrl+shift+p', 'f'), [True, True])
|
self.ae(tm('ctrl+shift+p', 'f'), [True, True])
|
||||||
|
|||||||
Reference in New Issue
Block a user