-
-
Notifications
You must be signed in to change notification settings - Fork 853
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: restore cursor to correct position on picker close
#2850
base: master
Are you sure you want to change the base?
Conversation
9b27ff0
to
2a369c3
Compare
7f57db1
to
6cabb46
Compare
let me run this for a couple of days before merging :D but thanks for addressing this issue :) |
f24a625
to
7264df4
Compare
i rebased the branch and continue to run it till friday, if there arent any issue till then, i think this is good to go thanks :) |
I found an regression with
|
The problem is that we're scheduling cursor position inside That why I had to schedule this so it happens after the cursor position is reset For this telescope.nvim/lua/telescope/builtin/__internal.lua Lines 778 to 784 in da8b3d4
Ideally, we just defer/schedule everything after |
Yeah idno how to cleanly fix this without API changes and big refactors. |
I think we have several factors contributing to flaky (off by one error) behaviors in the cursor position on picker close.
Mainly, I think we should be scheduling
nvim_win_set_cursor
. Without doing so, we've had to "arbitrarily" +1 on the columns to compensate:telescope.nvim/lua/telescope/actions/set.lua
Lines 214 to 216 in 87e92ea
This is made worse by a couple of other factors
nvim_win_set_cursor
expects 0-index.This wasn't previously an issue probably due to not scheduling
nvim_win_set_cursor
but I think we were just depending on UB.not accounting for original mode onselect_default
. like thisI think this is no longer necessary and was used to compensate for the lack of scheduling set cursor.
telescope.nvim/lua/telescope/actions/init.lua
Lines 388 to 390 in 87e92ea
I recognize this is a very sensitive part of our code that we've had repeat issues with so I still need to do some testing and verify this closes a few issues without any obvious or previously experienced regressions
closes #2319 and semi-related #2319 (comment)
closes #2849
closes #1366
TODO (all with both norma/insert mode as original mode):
--invert-match
for no col info)actions.close()
calls (like in Wrong cursor position after actions.close #2849)