-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow entering insert mode with sequence of commands #2051
Comments
C
binding
This is a temporary fix, at least for my particular keymap. self.last_insert.0 = match self.keymaps.get(mode, key) {
KeymapResult::Matched(command) => command,
KeymapResult::MatchedSequence(commands) => {
commands.last().unwrap().clone()
}
// FIXME: insert mode can only be entered through single KeyCodes
_ => unimplemented!(),
}; This works well for my keymap: [keys.normal]
C = ["collapse_selection", "extend_to_line_end", "change_selection"] But maybe |
@icanhazcheeze saw your implementation here too icanhazcheeze@930b4a5
Yeah exactly. Maybe the mode transition logic should happen in https://github.com/helix-editor/helix/blob/master/helix-term/src/ui/editor.rs#L803-L823= instead so we can determine the exact command that switched? |
Just want to drop a note here that I run into this multiple times a day via the trigger described in #3090. Thankfully, I save obsessively, so I don't lose a substantial amount of work from it. But it would be nice to see the priority bumped on this, since it's a crash that's very easy to accidentally trigger as a user even in Helix's default configuration. (Unfortunately, I don't have the bandwidth to try to fix this myself right now. :-/) |
I stumbled upon this error as well for the same reason (trying to remap |
Being able to use https://github.com/LGUG2Z/helix-vim without code changes would be awesome... |
I just want to make sure this is emphasized: this bug is easily triggered in the default configuration with no keybinding customization whatsoever. I have multiple crashes a day from this in the default configuration. I believe this is a critical bug. I am worried that this is getting lost due to the relatively benign title and description of this issue, which makes it sound like it's only preventing certain keybinding customizations. On the contrary, this is easily triggered (resulting in a crash) in a completely vanilla installation with zero custom configuration. The critical trigger for this bug is described in the now-marked-duplicate #3090. (I'm not intending to be pushy here, I just want to make sure this isn't lost among the comments that (unintentionally) obscure how critical a bug this is.) EDIT: This is a minimal config.toml that crashes in combination with following the steps in #3090:
Importantly, you never have to use the custom binding. It just has to be defined, and then follow the steps in #3090. It seems specific to the |
No worries! I realize I may have come across a bit aggressive, which wasn't my intention. I just wanted to make sure the issue didn't get lost in the weeds. Thanks so much for looking into it! |
Merged #2634 to resolve the panic but it would still be good to repeat the whole sequence: #2634 (comment) |
Summary
This is because it is
unimplemented!
helix/helix-term/src/ui/editor.rs
Lines 1180 to 1184 in 78b1600
Reproduction Steps
Setup a custom keybind:
and then press
C
in normal mode.Helix log
~/.cache/helix/helix.log
Platform
Linux
Terminal Emulator
Kitty
Helix Version
helix 22.05-dev (2d4f94e)
The text was updated successfully, but these errors were encountered: