code-server icon indicating copy to clipboard operation
code-server copied to clipboard

Easymotion does not work in the Vim plugin under Code-Server

Open konstantint opened this issue 3 years ago • 16 comments

  • Web Browser: Chrome
  • Local OS: Windows or ChromeOS
  • Remote OS: Ubuntu 16.04
  • Remote Architecture: x86_64
  • code-server --version: 3.9.3 fe2dc2deb08e378069891b622bb62ad1d261d1b1

Steps to Reproduce

  1. Install the VSCodeVim extension.
  2. Edit settings.json by copying over the quick example from the VSCodeVim page.
  3. Enter the easymotion shortcut (<space><space>w)

Expected

The plug-in should highlight first letters of the various words in the text to jump to. This is what happens if the same sequence of actions is performed on the vanilla VSCode (even with --extensions-dir=.local/share/code-server/extensions).

Actual

The cursor is moved one word forward (as if just w was pressed)

Notes

I do not see any errors in the browser console (and the server-side logs are probably irrelevant is vscodevim is a purely front-end extension). For starters it would be nice to check whether the issue is reproducible by someone else.

This issue can be reproduced in VS Code: No

konstantint avatar Apr 23 '21 09:04 konstantint

Using your repro steps

Hmm...I tested in both code-server and VS Code and I'm getting the same behavior listed in your bug report.

I enabled it by setting "vim.easymotion: true" in my settings.json.

https://user-images.githubusercontent.com/3806031/115904634-db945080-a419-11eb-84dd-aa3864fdf571.mov

Using vim-easymotion docs

Looking a bit more at the docs, I see The default leader has been changed to <Leader><Leader>

When I try using <Leader><Leader>w, it works in both code-server and VS Code as expected

https://user-images.githubusercontent.com/3806031/115905677-485c1a80-a41b-11eb-9416-14c3e0f3f403.mov

I also changed the leader key to "vim.leader": "<space>" and it still works.

https://user-images.githubusercontent.com/3806031/115906063-e0f29a80-a41b-11eb-8fa0-cd0c71870a8e.mov

Suggestion

Here are some ideas to help you further debug it:

  • uninstall all extensions, except Vim one and try again
  • try using the default vim.leader setting

I'm going to close this since it's not an issue on our side AFAICT. You can still comment on it though (I'll see it) and I'm happy to help you rubberduck/debug to get it working!

jsjoeio avatar Apr 23 '21 17:04 jsjoeio

Hm, that's strange.

By now I tried installing code-server in three different servers (2x Ubungu, 1x Chromebook Crostini), and tested several clients (2x Windows, ChromeOS). I tried both SSH-forwarding as well as a server with a proper DNS. I only used the Vim plugin on the code-server side and disabled all browser extensions (also tried with a guest account and incognito mode) and I can't get the behaviour you observe.

I do see that the <leader> key is detected correctly, no matter what setting I use - this is visible by the status bar indication (which shows <leader> when you press it). I can also use the remapping of the <leader>d sequence to act as dd (i.e. delete a line) and this works. I can even configure a remapping for <leader><leader>w to something else and it also works, yet it does not activate the Easymotion mode as it should (and, to reiterate, the same actions in vanilla VSCode works fine).

How do I debug this? Could I access the internals of the plugin from the Dev console somehow? Maybe there's a window.* variable exposed or breakpoint I could set somehow somewhere to understand what happens?

Perhaps those questions are better asked in VSCodeVim's repository, but maybe you have good ideas.

konstantint avatar Apr 24 '21 14:04 konstantint

Huh, strangely enough I'm able to reproduce. Running Firefox on Linux.

code-asher avatar Apr 26 '21 17:04 code-asher

I found that if the extension is installed via code-server --install-extension, then it works, however if it is installed via the marketplace UI (which makes it get installed as a "browser extension"), then it doesn't work.

rliang avatar May 27 '21 22:05 rliang

Tried both ways - doesn't work in either case for me.

konstantint avatar May 29 '21 16:05 konstantint

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

stale[bot] avatar Feb 08 '22 19:02 stale[bot]

Still not working as either "browser extension" or "remote extension"

code-server version: 4.0.1 735c6da829535969ff7193c79379299e4a1cb9bc vim plugin version: v1.22.2 chrome version: Version 98.0.4758.102 (Official Build) (64-bit) no chrome extensions enabled

https://github.com/VSCodeVim/Vim/issues/6540

nigelgbanks avatar Mar 18 '22 10:03 nigelgbanks

@nigelgbanks can you try upgrading to code-server 4.1.0?

jsjoeio avatar Mar 18 '22 16:03 jsjoeio

I'm running into this too on code-server v4.4.0. I've tried both installing the extension locally and via code-server --install-extension -- in both cases, the EasyMotion mode does not activate.

chromakode avatar May 28 '22 21:05 chromakode

@chromakode are there any browser/server logs you can share? Or steps to reproduce?

jsjoeio avatar May 31 '22 14:05 jsjoeio

possibly related https://github.com/VSCodeVim/Vim/issues/7238

code server used to install extensions on the server side, but after some version (4.x?) vim is installed to the browser. Vim plugins won't work anymore due to the issue above, not sure if it's intentional. I sent a PR about 2 weeks ago and this issue has been there longer but neither got any attention yet

joshuali925 avatar Jun 12 '22 03:06 joshuali925

Nice! Well let's hope they review and merge your PR soon!

jsjoeio avatar Jun 13 '22 14:06 jsjoeio

@chromakode are there any browser/server logs you can share? Or steps to reproduce?

[Extension Host] Remapper: trying to find matching remap. keys= . mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= . keySlice= . Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('<space>') took 1ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys=w. mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key=w. keySlice=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: Selections: Adding Selection Change to be Ignored! Hash: [2, 0; 2, 0], Selections: [2, 0], [2, 0] Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('w') took 1ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('w') took 3ms Dismiss Suppress Errors
console.ts:137 [Extension Host] Extension Startup: Selections: Ignoring selection: [2, 0; 2, 0], Count left: 0 Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys=w. mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key=w. keySlice=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: Selections: Adding Selection Change to be Ignored! Hash: [2, 1; 2, 1], Selections: [2, 1], [2, 1] Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('w') took 1ms Dismiss Suppress Errors
console.ts:137 [Extension Host] Extension Startup: Selections: Ignoring selection: [2, 1; 2, 1], Count left: 0 Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys=w. mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key=w. keySlice=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: Selections: Adding Selection Change to be Ignored! Hash: [3, 0; 3, 0], Selections: [3, 0], [3, 0] Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('w') took 1ms Dismiss Suppress Errors
console.ts:137 [Extension Host] Extension Startup: Selections: Ignoring selection: [3, 0; 3, 0], Count left: 0 Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=<space>. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys= . mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= . keySlice= . Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: normalModeKeyBindingsMap. potential remap found. waiting for other key or timeout to finish. Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('<space>') took 0ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=<space>. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys= , . mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= , . keySlice=  . Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= , . keySlice= . Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: normalModeKeyBindingsMap. potential remap broken. resending keys without allowing a potential remap on first key. keys= ,  Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=<space>. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys= . mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= . keySlice= . Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('<space>') took 1ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=<space>. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys= . mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= . keySlice= . Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: normalModeKeyBindingsMap. potential remap found. waiting for other key or timeout to finish. Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('<space>') took 0ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('<space>') took 1ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys= ,w. mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= ,w. keySlice= w. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= ,w. keySlice=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: normalModeKeyBindingsMap. potential remap broken. resending keys without allowing a potential remap on first key. keys= ,w Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=<space>. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys= . mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= . keySlice= . Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('<space>') took 1ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys=w. mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key=w. keySlice=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: Selections: Adding Selection Change to be Ignored! Hash: [3, 6; 3, 6], Selections: [3, 6], [3, 6] Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('w') took 1ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('w') took 2ms Dismiss Suppress Errors
console.ts:137 [Extension Host] Extension Startup: Selections: Ignoring selection: [3, 6; 3, 6], Count left: 0 Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=<space>. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys= . mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= . keySlice= . Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: normalModeKeyBindingsMap. potential remap found. waiting for other key or timeout to finish. Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('<space>') took 0ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=<space>. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys= , . mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= , . keySlice=  . Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= , . keySlice= . Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: normalModeKeyBindingsMap. potential remap broken. resending keys without allowing a potential remap on first key. keys= ,  Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=<space>. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys= . mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= . keySlice= . Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('<space>') took 1ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=<space>. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys= . mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= . keySlice= . Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: normalModeKeyBindingsMap. potential remap found. waiting for other key or timeout to finish. Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('<space>') took 0ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('<space>') took 1ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys= ,w. mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= ,w. keySlice= w. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= ,w. keySlice=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: normalModeKeyBindingsMap. potential remap broken. resending keys without allowing a potential remap on first key. keys= ,w Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=<space>. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys= . mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key= . keySlice= . Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('<space>') took 0ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handling key=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: trying to find matching remap. keys=w. mode=Normal. keybindings=normalModeKeyBindingsMap. Dismiss Suppress Errors
console.ts:137 [Extension Host] Remapper: key=w. keySlice=w. Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: Selections: Adding Selection Change to be Ignored! Hash: [3, 8; 3, 8], Selections: [3, 8], [3, 8] Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('w') took 2ms Dismiss Suppress Errors
console.ts:137 [Extension Host] ModeHandler: handleKeyEvent('w') took 3ms Dismiss Suppress Errors
console.ts:137 [Extension Host] Extension Startup: Selections: Ignoring selection: [3, 8; 3, 8], Count left: 0 Dismiss Suppress Errors

yingpwu avatar Jan 16 '23 02:01 yingpwu

So I ran into this problem today and did a little regression testing since I would really like to use the plugin and found the breaking update is in the plugin its-self from 1.21.8 onward.

I currently have 1.21.7 installed and everything works as expected but the minute I install a more recent version code-server no longer registered the key presses

code-server version: 4.16.1

micahnz avatar Sep 14 '23 12:09 micahnz

So I ran into this problem today and did a little regression testing since I would really like to use the plugin and found the breaking update is in the plugin its-self from 1.21.8 onward.

I currently have 1.21.7 installed and everything works as expected but the minute I install a more recent version code-server no longer registered the key presses

code-server version: 4.16.1

can confirm this. Though my code-server is on a much older version: 1.17.1

GeekNOmore avatar Dec 02 '23 00:12 GeekNOmore

I haven't got much response from vscodevim members in my PR whether it will be merged or not, but someone left a comment there that they were able to build and install the custom vscodevim extension with the fix https://github.com/VSCodeVim/Vim/pull/7728#issuecomment-1605889568

if you run into this issue you can probably do the same or just install their build (at your own discretion)

joshuali925 avatar Dec 02 '23 03:12 joshuali925