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

Motions from lightspeed.nvim don't work for certain char arguments #1539

Closed
hallettj opened this issue Sep 15, 2022 · 4 comments
Closed

Motions from lightspeed.nvim don't work for certain char arguments #1539

hallettj opened this issue Sep 15, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@hallettj
Copy link
Contributor

Describe the bug
This bug comes up specifically when using lightspeed.nvim. I'm reporting it here because the problem occurs in Neovide, but does not occur when running nvim in a terminal.

Lightspeed overrides some movement commands like f and t. When attempting to use those custom movements to move to certain characters such as < instead of the expected behavior I see this error message:

not found: <80><fc>^B<

I have seen this problem with the characters < and |. The problem does not occur with > or with alphanumeric characters.

Using git bisect I found that this issue was introduced by #1483.

I tried reading the Lightspeed source to come up with a more minimal reproduction, but the Fennel code is a bit much for me to decipher right now. The function that handles 1-character search is ft.go.

To Reproduce
Steps to reproduce the behavior:

  1. Install lightspeed.nvim
  2. Open a file with this content: const x = 1 < 3
  3. With the cursor at the beginning of that line in normal mode, type yt<

Expected behavior
There should be no error message. The default register should contain the text const x = 1 .

Actual behavior
This error message is reported upon typing <:

not found: <80><fc>^B<

Desktop (please complete the following information):

  • OS: Debian Testing (bookworm)
  • Neovide Versions 346dc05 and later commits in main
  • Neovim Versions NVIM v0.7.2, NVIM v0.8.0-dev-1064-g48e060f64, and NVIM v0.8.0-dev-1092-g89b9eab63 (latest nightly as of Sept 15 2022)

Please run neovide --log and paste the contents of the .log file created in the current directory here:
https://gist.github.com/hallettj/d5ed3158d1ee9a89a34968502b4cd4ae

@hallettj hallettj added the bug Something isn't working label Sep 15, 2022
@hallettj
Copy link
Contributor Author

I've noticed another issue with the < key. When viewing git status with fugitive there are bindings for > to expand the diff for a file, and < collapses the diff. After #1483 pressing < in a fugitive buffer puts the editor into operator pending mode instead of collapsing the diff. (But > still works as expected.) It's possible there is an interaction with another one of my plugins here. If I get more information I may open another issue.

@s-cerevisiae
Copy link
Contributor

s-cerevisiae commented Sep 16, 2022

Luckily I know some Fennel, and after some tracing I've found the minimal reproduction:

:echo getcharstr()

Then type <.

I'm going to test the actual output of the format_keybinding_string function.

Edit: It seems that before #1483 < was sent as <lt>, after that it became <S-lt>, which is actually illegal and leads to this problem. I think there might be better fix than simply reverting #1483 or adding a few lines of code, but I'm going to have a rest now.

@s-cerevisiae
Copy link
Contributor

The fix is now merged. Would you like to test it?

@hallettj
Copy link
Contributor Author

I'm sorry I didn't see your message sooner. Yes, the fix is working nicely, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants