Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Key Remapping crashes helix v0.5.0 #1289

Closed
PhilipK opened this issue Dec 18, 2021 · 9 comments
Closed

Key Remapping crashes helix v0.5.0 #1289

PhilipK opened this issue Dec 18, 2021 · 9 comments
Labels
A-keymap Area: Keymap and keybindings C-bug Category: This is a bug

Comments

@PhilipK
Copy link

PhilipK commented Dec 18, 2021

Reproduction steps

  1. Copy the key remapping found here https://docs.helix-editor.com/remapping.html#key-remapping
  2. Add it to ~/.config/helix/config.toml
  3. Run helix

Helix crashes with the following message:
Error: data did not match any variant of untagged enum KeyTrie for key keys.normal at line 11 column 1

Environment

  • Platform: Linux
  • Helix version: 0.5.0
@PhilipK PhilipK added the C-bug Category: This is a bug label Dec 18, 2021
@PhilipK
Copy link
Author

PhilipK commented Dec 18, 2021

It seems this problem happens any time [keys.normal] or [insert] is added to the config

@PhilipK PhilipK changed the title Example Key Remapping crashes helix Key Remapping crashes helix Dec 18, 2021
@PhilipK
Copy link
Author

PhilipK commented Dec 18, 2021

This seems to have been solved in helix v0.5.0-257-g02fc52f when i build from master key remapping is possible

@sudormrfbin
Copy link
Member

The docs are built from master and not the latest tagged release, hence the error.

@PhilipK
Copy link
Author

PhilipK commented Dec 18, 2021

The only difference between
https://github.com/helix-editor/helix/blob/v0.5.0/book/src/remapping.md

and

https://github.com/helix-editor/helix/blob/master/book/src/remapping.md

Is the added ctrl+s to save.
If i use the configuration from 0.5.0 the problem is still there.

@sudormrfbin
Copy link
Member

I think you missed "ret" = ["open_below", "normal_mode"] which allows executing multiple commands, added after 0.5.

@kirawi kirawi added the A-keymap Area: Keymap and keybindings label Dec 18, 2021
@PhilipK
Copy link
Author

PhilipK commented Dec 19, 2021

Still a problem on 0.5.0.
Here is some more information.
Here is what i did on an (almost) clean install of Arch Linux

  1. Use yay -S helix to download helix-0.5.0-1
  2. run helix and it starts no problem
  3. Verify that helix is version 0.5.0 with -V argument
  4. create a config.toml at ~/.config/helix/config.toml
  5. Write the following to config.toml
[keys.normal]
C-s = ":w"
"ret" = ["open_below", "normal_mode"]
  1. Run helix again, and get the following error
Error: data did not match any variant of untagged enum KeyTrie for key `keys.normal` at line 2 column 1
  1. Edit the config.tomlto
[keys.normal]
"ret" = ["open_below", "normal_mode"]
  1. Run helix again, and get the same error

@PhilipK PhilipK changed the title Key Remapping crashes helix Key Remapping crashes helix v0.5.0 Dec 19, 2021
@archseer
Copy link
Member

archseer commented Dec 19, 2021

Yeah, "ret" = ["open_below", "normal_mode"] won't work on 0.5.0 but it will work on the latest master since this feature (#589) was implemented after 0.5.0 was released.

@PhilipK
Copy link
Author

PhilipK commented Dec 19, 2021

This works:

[keys.normal]
a = "move_char_left"

so does this:

[keys.normal]
C-s = "move_char_left"

but this:

[keys.normal]
s = ":w"

and this:

[keys.normal]
s = ":write"

and this:

[keys.normal]
s = ":q"

Does not work. It seems to be related to keymapping a command

@archseer
Copy link
Member

Yes, that's another feature that landed after 0.5. Mapping sequences of commands and and :commands is only possible on master until a new release comes out.

@PhilipK PhilipK closed this as completed Dec 19, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-keymap Area: Keymap and keybindings C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

4 participants