helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.77k stars 2.51k forks source link

Mapping C-/ fails #3210

Closed thor314 closed 1 year ago

thor314 commented 2 years ago

Summary

The following produces no errors, but fails:

[keys.normal]
"C-/" = "toggle_comments" #nope

The following produces an error, and fails:

[keys.normal]
C-/ = "toggle_comments" #nope

The following works as expected:

[keys.normal]
"/" = "toggle_comments"

Recommended short term action: make a note in the key-remapping section in docs, until bug can be resolved.

Reproduction Steps

No response

Helix log

Config file: /home/thor/.config/helix/config.toml Language file: /home/thor/.config/helix/languages.toml Log file: /home/thor/.cache/helix/helix.log Runtime directory: /home/thor/.config/helix/runtime

Language           LSP                DAP                Highlight          Textobject         Indent             
bash               ✔ bash-language…   None               ✔                  ✘                  ✘                  
c                  ✘ clangd           ✔ lldb-vscode      ✔                  ✔                  ✔                  
c-sharp            ✘ OmniSharp        None               ✔                  ✘                  ✘                  
cairo              None               None               ✔                  ✘                  ✘                  
clojure            ✘ clojure-lsp      None               ✔                  ✘                  ✘                  
cmake              ✘ cmake-languag…   None               ✔                  ✔                  ✔                  
comment            None               None               ✔                  ✘                  ✘                  
cpon               None               None               ✔                  ✘                  ✔                  
cpp                ✘ clangd           ✔ lldb-vscode      ✔                  ✔                  ✔                  
css                ✘ vscode-css-la…   None               ✔                  ✘                  ✘                  
dart               ✘ dart             None               ✔                  ✘                  ✔                  
devicetree         None               None               ✔                  ✘                  ✔                  
dockerfile         ✘ docker-langse…   None               ✔                  ✘                  ✘                  
edoc               None               None               ✔                  ✘                  ✘                  
eex                None               None               ✔                  ✘                  ✘                  
ejs                None               None               ✔                  ✘                  ✘                  
elixir             ✘ elixir-ls        None               ✔                  ✔                  ✘                  
elm                ✘ elm-language-…   None               ✔                  ✘                  ✘                  
elvish             ✘ elvish           None               ✔                  ✘                  ✘                  
erb                None               None               ✔                  ✘                  ✘                  
erlang             ✘ erlang_ls        None               ✔                  ✔                  ✘                  
fish               None               None               ✔                  ✔                  ✔                  
fortran            ✘ fortls           None               ✔                  ✘                  ✔                  
gdscript           None               None               ✔                  ✘                  ✔                  
git-attributes     None               None               ✔                  ✘                  ✘                  
git-commit         None               None               ✔                  ✘                  ✘                  
git-config         None               None               ✔                  ✘                  ✘                  
git-diff           None               None               ✔                  ✘                  ✘                  
git-ignore         None               None               ✔                  ✘                  ✘                  
git-rebase         None               None               ✔                  ✘                  ✘                  
gleam              ✘ gleam            None               ✔                  ✔                  ✘                  
glsl               None               None               ✔                  ✔                  ✔                  
go                 ✘ gopls            ✘ dlv              ✔                  ✔                  ✔                  
gomod              ✘ gopls            None               ✔                  ✘                  ✘                  
gowork             ✘ gopls            None               ✔                  ✘                  ✘                  
graphql            None               None               ✔                  ✘                  ✘                  
hare               None               None               ✔                  ✘                  ✔                  
haskell            ✘ haskell-langu…   None               ✔                  ✘                  ✘                  
hcl                ✘ terraform-ls     None               ✔                  ✘                  ✔                  
heex               None               None               ✔                  ✘                  ✘                  
html               ✘ vscode-html-l…   None               ✔                  ✘                  ✘                  
idris              ✘ idris2-lsp       None               ✘                  ✘                  ✘                  
iex                None               None               ✔                  ✘                  ✘                  
java               ✘ jdtls            None               ✔                  ✘                  ✘                  
javascript         ✘ typescript-la…   ✘                  ✔                  ✘                  ✔                  
jsdoc              None               None               ✔                  ✘                  ✘                  
json               ✘ vscode-json-l…   None               ✔                  ✘                  ✔                  
jsx                ✘ typescript-la…   None               ✔                  ✘                  ✔                  
julia              ✘ julia            None               ✔                  ✘                  ✘                  
kotlin             ✘ kotlin-langua…   None               ✔                  ✘                  ✘                  
latex              ✘ texlab           None               ✔                  ✘                  ✘                  
lean               ✘ lean             None               ✔                  ✘                  ✘                  
ledger             None               None               ✔                  ✘                  ✘                  
llvm               None               None               ✔                  ✔                  ✔                  
llvm-mir           None               None               ✔                  ✔                  ✔                  
llvm-mir-yaml      None               None               ✔                  ✘                  ✔                  
lua                ✘ lua-language-…   None               ✔                  ✘                  ✔                  
make               None               None               ✔                  ✘                  ✘                  
markdown           None               None               ✔                  ✘                  ✘                  
meson              None               None               ✔                  ✘                  ✔                  
mint               ✘ mint             None               ✘                  ✘                  ✘                  
nickel             ✘ nls              None               ✔                  ✘                  ✔                  
nix                ✘ rnix-lsp         None               ✔                  ✘                  ✔                  
nu                 None               None               ✔                  ✘                  ✘                  
ocaml              ✘ ocamllsp         None               ✔                  ✘                  ✔                  
ocaml-interface    ✘ ocamllsp         None               ✔                  ✘                  ✘                  
odin               None               None               ✔                  ✘                  ✘                  
openscad           ✘ openscad-lang…   None               ✔                  ✘                  ✘                  
org                None               None               ✔                  ✘                  ✘                  
perl               None               None               ✔                  ✔                  ✔                  
php                ✘ intelephense     None               ✔                  ✔                  ✔                  
prisma             ✘ prisma-langua…   None               ✔                  ✘                  ✘                  
prolog             ✘ swipl            None               ✘                  ✘                  ✘                  
protobuf           None               None               ✔                  ✘                  ✔                  
python             ✔ pylsp            None               ✔                  ✔                  ✘                  
r                  ✘ R                None               ✔                  ✘                  ✘                  
racket             ✘ racket           None               ✘                  ✘                  ✘                  
regex              None               None               ✔                  ✘                  ✘                  
rescript           ✘ rescript-lang…   None               ✔                  ✔                  ✘                  
rmarkdown          ✘ R                None               ✔                  ✘                  ✔                  
ron                None               None               ✔                  ✘                  ✔                  
ruby               ✘ solargraph       None               ✔                  ✔                  ✔                  
rust               ✔ rust-analyzer…   ✔ lldb-vscode      ✔                  ✔                  ✔                  
scala              ✘ metals           None               ✔                  ✘                  ✔                  
scheme             None               None               ✔                  ✘                  ✘                  
scss               ✘ vscode-css-la…   None               ✔                  ✘                  ✘                  
solidity           ✘ solc             None               ✔                  ✘                  ✘                  
sql                None               None               ✔                  ✘                  ✘                  
sshclientconfig    None               None               ✔                  ✘                  ✘                  
starlark           None               None               ✔                  ✔                  ✘                  
svelte             ✘ svelteserver     None               ✔                  ✘                  ✔                  
swift              ✘ sourcekit-lsp…   None               ✔                  ✘                  ✘                  
tablegen           None               None               ✔                  ✔                  ✔                  
tfvars             ✘ terraform-ls     None               ✘                  ✘                  ✘                  
toml               ✔ taplo            None               ✔                  ✘                  ✘                  
tsq                None               None               ✔                  ✘                  ✘                  
tsx                ✘ typescript-la…   None               ✔                  ✘                  ✘                  
twig               None               None               ✔                  ✘                  ✘                  
typescript         ✘ typescript-la…   None               ✔                  ✘                  ✔                  
ungrammar          None               None               ✔                  ✘                  ✘                  
v                  ✘ vls              None               ✔                  ✘                  ✘                  
vala               ✘ vala-language…   None               ✔                  ✘                  ✘                  
verilog            ✘ svlangserver     None               ✔                  ✔                  ✘                  
vue                ✘ vls              None               ✔                  ✘                  ✘                  
wgsl               ✘ wgsl_analyzer…   None               ✔                  ✘                  ✘                  
yaml               ✘ yaml-language…   None               ✔                  ✘                  ✔                  
zig                ✘ zls              None               ✔                  ✘                  ✔                  

Platform

PopOS linux-gnu

Terminal Emulator

alacritty 0.11.0-dev (63ef6c93)

Helix Version

helix 22.05 (19e51c82)

the-mikedavis commented 2 years ago

The

[keys.normal]
C-/ = "toggle_comments" #nope

case is expected: that's invalid TOML.

It looks like the terminal or crossterm are a bit confused about the C-/. Using crossterm's event-read example:

Event: Key(KeyEvent { code: Char('/'), modifiers: NONE })
Event: Key(KeyEvent { code: Char('7'), modifiers: CONTROL })

It's interpreted as C-7 🤔

I think this falls under https://github.com/helix-editor/helix/issues/1085