Don't make cursor moves when closing cmdwin with nosplitscroll#11128
Don't make cursor moves when closing cmdwin with nosplitscroll#11128mityu wants to merge 1 commit intovim:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11128 +/- ##
=======================================
Coverage 81.80% 81.80%
=======================================
Files 162 162
Lines 188322 188325 +3
Branches 42832 42832
=======================================
+ Hits 154057 154065 +8
+ Misses 21725 21713 -12
- Partials 12540 12547 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
Oh sorry, information about my environment is missing.
|
|
Nice, LGTM. |
|
Hmm scrolling happens when the cursor is at the end of a buffer. |
|
@luukvbaal How can I reproduce it? |
|
Give me a sec, setting up dev environment on my PC lol. Usually work on my laptop but it's power adapter died. |
|
Wow that was a hard find @mityu @brammool. I noticed the issue in some dotfile on my system, but figuring out a repro command proved difficult. The issue somehow only happens when the cursor is on a matched character i.e. (){}[]. AFAIK matchparen is responsible for adding this highlighting so to reproduce it you need matchparen enabled. Seems very unrelated I know, but it seems to reproduce the scrolling... |
|
It doesn't happen with Vim9.0.464, so it's must a new bug caused by this PR. I'll looking into this later. |
|
Yeah I had noticed the cursor changing seemingly unnecessarily while developing the option. Didn't investigate further yet as it seemed complicated. I think I found a fix now for the cmdwin cursor issue that doesn't mess up the scrolling for autocmd case. I'll open the PR(#11134), thanks for pointing me in the right direction @mityu. |
vim-patch:9.0.0445: when opening/closing window text moves up/down
Problem: When opening/closing window text moves up/down.
Solution: Add the 'splitscroll' option. When off text will keep its
position as much as possible.
vim/vim@29ab524
vim-patch:9.0.0455: a few problems with 'splitscroll'
Problem: A few problems with 'splitscroll'.
Solution: Fix 'splitscroll' problems. (Luuk van Baal, closes vim/vim#11117)
vim/vim@5ed3917
vim-patch:9.0.0461: 'scroll' is not always updated
Problem: 'scroll' is not always updated.
Solution: Call win_init_size() at the right place.
vim/vim@470a141
vim-patch:9.0.0465: cursor moves when cmdwin is closed when 'splitscroll' is off
Problem: Cursor moves when cmdwin is closed when 'splitscroll' is off.
Solution: Temporarily set 'splitscroll' when jumping back to the original
window. (closes vim/vim#11128)
vim/vim@e697d48
vim-patch:9.0.0469: cursor moves if cmdwin is closed when 'splitscroll' is off
Problem: Cursor moves if cmdwin is closed when 'splitscroll' is off.
Solution: Skip win_fix_cursor if called when cmdwin is open or closing.
(Luuk van Baal, closes vim/vim#11134)
vim/vim@3735f11
vim-patch:9.0.0478: test for 'splitscroll' takes too much time
Problem: Test for 'splitscroll' takes too much time.
Solution: Only test some of the combinations. (Luuk van Baal, closes vim/vim#11139)
vim/vim@594f9e0
vim-patch:9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Problem: Text scrolled with 'nosplitscroll', autocmd win opened and help
window closed.
Solution: Skip win_fix_scroll() in more situations. (Luuk van Baal,
closes vim/vim#11150)
vim/vim@d5bc762
vim-patch:9.0.0505: various problems with 'nosplitscroll'
Problem: Various problems with 'nosplitscroll'.
Solution: Fix 'nosplitscroll' problems. (Luuk van Baal, closes vim/vim#11166)
vim/vim@faf1d41
vim-patch:9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Problem: Scrolling with 'nosplitscroll' in callback changing curwin.
Solution: Invalidate w_cline_row in the right place. (Luuk van Baal,
closes vim/vim#11185)
vim/vim@20e5856
vim-patch:9.0.0603: with 'nosplitscroll' folds are not handled correctly
Problem: With 'nosplitscroll' folds are not handled correctly.
Solution: Take care of closed folds when moving the cursor. (Luuk van Baal,
closes vim/vim#11234)
vim/vim@7c1cbb6
vim-patch:9.0.0605: dump file missing
Problem: Dump file missing.
Solution: Add the missing dump file. (issue vim/vim#11234)
vim/vim@439a2ba
vim-patch:9.0.0647: the 'splitscroll' option is not a good name
Problem: The 'splitscroll' option is not a good name.
Solution: Rename 'splitscroll' to 'splitkeep' and make it a string option,
also supporting "topline". (Luuk van Baal, closes vim/vim#11258)
vim/vim@13ece2a
vim-patch:9.0.0667: ml_get error when 'splitkeep' is "screen"
Problem: ml_get error when 'splitkeep' is "screen". (Marius Gedminas)
Solution: Check the botline is not too large. (Luuk van Baal,
closes vim/vim#11293, closes vim/vim#11292)
vim/vim@346823d
vim-patch:9.0.0445: when opening/closing window text moves up/down
Problem: When opening/closing window text moves up/down.
Solution: Add the 'splitscroll' option. When off text will keep its
position as much as possible.
vim/vim@29ab524
vim-patch:9.0.0455: a few problems with 'splitscroll'
Problem: A few problems with 'splitscroll'.
Solution: Fix 'splitscroll' problems. (Luuk van Baal, closes vim/vim#11117)
vim/vim@5ed3917
vim-patch:9.0.0461: 'scroll' is not always updated
Problem: 'scroll' is not always updated.
Solution: Call win_init_size() at the right place.
vim/vim@470a141
vim-patch:9.0.0465: cursor moves when cmdwin is closed when 'splitscroll' is off
Problem: Cursor moves when cmdwin is closed when 'splitscroll' is off.
Solution: Temporarily set 'splitscroll' when jumping back to the original
window. (closes vim/vim#11128)
vim/vim@e697d48
vim-patch:9.0.0469: cursor moves if cmdwin is closed when 'splitscroll' is off
Problem: Cursor moves if cmdwin is closed when 'splitscroll' is off.
Solution: Skip win_fix_cursor if called when cmdwin is open or closing.
(Luuk van Baal, closes vim/vim#11134)
vim/vim@3735f11
vim-patch:9.0.0478: test for 'splitscroll' takes too much time
Problem: Test for 'splitscroll' takes too much time.
Solution: Only test some of the combinations. (Luuk van Baal, closes vim/vim#11139)
vim/vim@594f9e0
vim-patch:9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Problem: Text scrolled with 'nosplitscroll', autocmd win opened and help
window closed.
Solution: Skip win_fix_scroll() in more situations. (Luuk van Baal,
closes vim/vim#11150)
vim/vim@d5bc762
vim-patch:9.0.0505: various problems with 'nosplitscroll'
Problem: Various problems with 'nosplitscroll'.
Solution: Fix 'nosplitscroll' problems. (Luuk van Baal, closes vim/vim#11166)
vim/vim@faf1d41
vim-patch:9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Problem: Scrolling with 'nosplitscroll' in callback changing curwin.
Solution: Invalidate w_cline_row in the right place. (Luuk van Baal,
closes vim/vim#11185)
vim/vim@20e5856
vim-patch:9.0.0603: with 'nosplitscroll' folds are not handled correctly
Problem: With 'nosplitscroll' folds are not handled correctly.
Solution: Take care of closed folds when moving the cursor. (Luuk van Baal,
closes vim/vim#11234)
vim/vim@7c1cbb6
vim-patch:9.0.0605: dump file missing
Problem: Dump file missing.
Solution: Add the missing dump file. (issue vim/vim#11234)
vim/vim@439a2ba
vim-patch:9.0.0647: the 'splitscroll' option is not a good name
Problem: The 'splitscroll' option is not a good name.
Solution: Rename 'splitscroll' to 'splitkeep' and make it a string option,
also supporting "topline". (Luuk van Baal, closes vim/vim#11258)
vim/vim@13ece2a
vim-patch:9.0.0667: ml_get error when 'splitkeep' is "screen"
Problem: ml_get error when 'splitkeep' is "screen". (Marius Gedminas)
Solution: Check the botline is not too large. (Luuk van Baal,
closes vim/vim#11293, closes vim/vim#11292)
vim/vim@346823d

When
set nosplitscroll, sometimes the cursor position of the current window is changed after closing cmdwin.It shouldn't happen since no cursor moves on the current window happens when leaving command-line.
Steps to reproduce
vim -u NONE --cmd "set nosplitscroll | call setline(1, range(1, &lines)) | normal L".q:<C-w>qand check the cursor position.Images
before

after
