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

fix: dot-repeat special symbols handling #1167

Conversation

archilkarchava
Copy link
Contributor

@archilkarchava archilkarchava commented Mar 4, 2023

Due to the way dot-repeat currently works, typing (or pasting) text that contains special strings like or , or < in the Insert mode and then exiting the Insert mode will result in unexpected behavior.

Here are a couple of examples where extension behaves unexpectedly:

"<BS>" example

  1. Type (or paste) in insert mode ""
  2. Press Enter (adds new line)
  3. Press Escape (switches to Normal mode)
  4. Press . (dot)

Expected output:

<BS><BS>
<BS

Actual output:

<BS><BS>
<BS

Demo

BS._handling.mp4

<LT><cmd>call VSCodeNotify('workbench.action.files.openFile') command injection example (also works with other commands, as well as with "<<Cmd>" instead of "<LT><Cmd>")

  1. Type (or paste) in insert mode "<LT><cmd>call VSCodeNotify('workbench.action.files.openFile')"
  2. Press Enter (adds new line character)
  3. Press Escape (switches to Normal mode)

Expected output:

\<LT\>\<cmd\>call VSCodeNotify('workbench.action.files.openFile')

Actual output is the same as the expected output, but the workbench.action.files.openFile command gets called

Demo

Cmd._handling.mp4

Fixes #1185

@wenfangdu
Copy link
Contributor

Confirmed, fixes #1185 on a Mac.

@justinmk
Copy link
Collaborator

Confirmed, fixes #1185 on a Mac.

Thanks. Need a Windows user to help out with the test failure.

@theol0403 theol0403 self-assigned this Jul 5, 2023
@archilkarchava
Copy link
Contributor Author

@theol0403, I fixed the test.

@theol0403 theol0403 merged commit 5e955d6 into vscode-neovim:master Oct 5, 2023
7 of 8 checks passed
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

Successfully merging this pull request may close these issues.

[Bug] vscode-neovim runs pasted code after hitting Esc ???!!!
4 participants