Skip to content

Commit

Permalink
Persist register selection in pending keymaps
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
the-mikedavis authored and archseer committed Jun 7, 2023
1 parent 77e9a22 commit 0e08349
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,8 @@ impl EditorView {
self.handle_keymap_event(mode, cxt, event);
if self.keymaps.pending().is_empty() {
cxt.editor.count = None
} else {
cxt.editor.selected_register = cxt.register.take();
}
}
}
Expand Down

0 comments on commit 0e08349

Please sign in to comment.