71 / dance

Make your cursors dance with Kakoune-like modal editing in VS Code.
https://marketplace.visualstudio.com/items?itemName=gregoire.dance
ISC License
424 stars 52 forks source link

Certain single-letter registers unexpectedly map to special registers #318

Closed mjpieters closed 8 months ago

mjpieters commented 8 months ago

Type: Bug

When I try to use one of several ASCII letter register names when executing dance.selectRegister (" in normal mode), I see that instead one of the default or special registers is selected. This happens regardless of keyboard layout or the "keyboard.dispatch": "keyCode" setting, and happens to both the lowercase and uppercase form of these letters.

For example, I can't use u as a register name, it instead selects the underscore register.

To reproduce, make a selection and in normal mode, type "u. Observe that the selected register icon in the status bar now shows _. If you now type y (yank) an errorr message tells you that register "_" cannot be used to save text.

Other letters affected are:

The mapping doesn't provide access to the other special registers that happen to have the same starting letter (so no access to dquote, caret or pipe via a single letter). Moreover, I can already just use the special register symbols to select those (e.g. "% to access the current buffer name register).

I can see that these registrations were made deliberately, but this implementation doesn't match that of Kakoune (which uses a separate hashmap to map full names to single (symbol) characters for special registers). The mapping is not documented, and is rather confusing. I thought at first that my use of the Dvorak keyboard layout was to blame, and because my first attempts all involved the register u I thought no registers worked and you always got the null register because of an error somewhere.

Please let me use all ascii letters as register names, just like in Kakoune.

Extension version: 0.5.12004 VS Code version: Code 1.83.1 (f1b07bd25dfad64b0167beb15359ae573aecd2cc, 2023-10-10T23:57:32.750Z) OS version: Darwin arm64 21.6.0 Modes: Remote OS version: Linux x64 5.10.0-0.deb10.16-amd64

71 commented 8 months ago

Thanks for the report! Indeed that's inconsistent with Kakoune, I'm not sure why I thought Kakoune had single-letter accesses to these registers.