Skip to content

Commit 0e08349

Browse files
the-mikedavisarchseer
authored andcommitted
Persist register selection in pending keymaps
Previously the register selection (via `"`) would be lost in the middle of any key sequence longer than one key. For example, `<space>f` would clear the register selection after the `<space>` making it inaccessible for the `file_picker` command. This behavior does not currently have any effect in the default keymap but might affect custom keymaps. This change aligns the behavior of the register with count. Making this change allows propagating the register to the `command_palette` (see the child commit) or other pickers should we decide to use registers in those in the future. (Interactive global search for example.)
1 parent 77e9a22 commit 0e08349

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

helix-term/src/ui/editor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,8 @@ impl EditorView {
943943
self.handle_keymap_event(mode, cxt, event);
944944
if self.keymaps.pending().is_empty() {
945945
cxt.editor.count = None
946+
} else {
947+
cxt.editor.selected_register = cxt.register.take();
946948
}
947949
}
948950
}

0 commit comments

Comments
 (0)