Skip to content
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

The literal string "<leader>" is substituted for the leader key when repeating a command-line command. #8975

Open
mvandenhoek opened this issue Apr 6, 2024 · 0 comments

Comments

@mvandenhoek
Copy link

mvandenhoek commented Apr 6, 2024

Describe the bug
The literal string "<leader>" is substituted for the leader key when repeating a command-line command using @: or @@. The result is that the command either errors or does something else than intended. The following will show the bug with two different leader keys. These were also tested on two environments, showing the same symptoms.

To Reproduce the bug in case with leader \ (backslash)
Steps to reproduce the behavior:

  1. Go to vscode settings and search for "vim leader".
  2. Find the option "What key should <leader> map to in remappings?", and set the leader key to \ (backslash).
  3. Open a new text file and insert the sentence The quick brown fox jumps over the lazy dog. (using tabs rather than spaces), and save the file.
  4. Try to replace tabs by spaces by doing command :s/\t/ (after the last / is a single space).
  5. See the resulting string The quick brown fox jumps over the lazy dog. (It replaced the first tab by a space, as expected).
  6. Try to repeat last command by @:.
  7. See thrown error E486: Pattern not found: <leader>t.
  8. Type : then arrow up to see most recent command, this reveals :s/<leader>t/ .

To Reproduce the bug in case with leader (one space)
Steps to reproduce the behavior:

  1. Go to vscode settings and search for "vim leader".
  2. Find the option "What key should <leader> map to in remappings?", and set the leader key to (one space).
  3. Open a new text file and insert the sentence The quick brown fox jumps over the lazy dog. (using tabs rather than spaces), and save the file.
  4. Try to replace tabs by spaces by doing command :s/\t/ (after the last / is a single space).
  5. See the resulting string The quick brown fox jumps over the lazy dog. (It replaced the first tab by a space, as expected).
  6. Try to repeat last command by @:.
  7. See the resulting string The quick<leader>brown fox jumps over the lazy dog. (not the intended result, it replaced character \t by the string "<leader>").
  8. Type : then arrow up to see most recent command, this reveals :s/\t/<leader>.
  9. Repeately press @@
  10. See the resulting string The quick<leader>brown<leader>fox<leader>jumps<leader>over<leader>the<leader>lazy<leader>dog..

Expected behavior (same for both cases)
Repeating the command with @: or @@ replaces a tab by a space each time it is used.

Environment 1:

  • Extension (VsCodeVim) version: v1.27.2
  • VSCode version: March 2024 (version 1.88)
  • OS: Windows 10

Environment 2:

  • Extension (VsCodeVim) version: v1.27.2
  • VSCode version: March 2024 (version 1.88)
  • OS: Ubuntu 22.04.4 LTS (Jammy Jellyfish)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant