-
-
Notifications
You must be signed in to change notification settings - Fork 618
fix: hijack_cursor with update_focused_file #2600
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
Conversation
Unfortunately this doesn't always work. It seems the issue might be with
|
It also looks like the |
I don't find any issues, but yeah, there are better ways to resolve, which require more code to change. nvim-tree.lua/lua/nvim-tree.lua Lines 115 to 121 in 50f30bc
For me removing this check fixes the issue. Git blame says it was search fix, can you describe more about this? How can we change it. Actually it is, without this check you can't go next in search using n but can go prev with N . Seems that we need to find better way to handle if search with hijack_cursor.
|
That is very old code indeed, unfortunately I have no insight. It could be from a time when there was no root node or there was something else on the top line, perhaps the search input.
Correct me if I'm wrong, but it looks like we don't have any search
Yes please. It's actually failing to hijack the root node itself. This is only called in one place and we can easily test it. Do you want to just rewrite that method? It's clear what it needs to do and can be very simple. |
I am about native neovim |
Ah I see, I completely misunderstood. I was thinking about This is quite tricky. The Do you want to try writing a "clean" implementation? It seems clear what the requirements are now. |
I don't think we need completely rewrite impl, just to figure out how to handle search better. Any ideas, how to detect if search, or maybe detect params of text under cursor? Currently I have no way to solve it. |
Ah yes, that would do it. Looking at lualine it's using |
My assumption is that we can get search entries through extmarks and if cursor under search extmark we skip hijacking. |
Yes please... that will inform us whether we are searching inside the nvim-tree window AND we are on the match. |
Seems that we can't do that with extmarks. I checked |
6a31f24
to
5659f78
Compare
5659f78
to
24b5a11
Compare
So what do you think about current solution? |
Well, that's rather elegant. Cursor is always correctly placed on n/N and is hijacked on j/k
Regression: user can't move horizontally on a node with h/l. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic work as always @geril2207
Fix: #2599