Conversation
This commit does two things: --- First, existing zt/zb/zz implementation is buggy when 'smoothscroll' are 'wrap' are set. They can lead to inconsistency bugs with regarding to repainting and cursor states. For zz, if the user uses `zz` whenever the top line is smooth-scrolled, the resulting draw will be wrong. For zt, if the line above the current line is super long (meaning it is so long that the wrapped line covers more than the entire screen), it will lead to the cursor being in a bad state. For zb, the exact conditions are harder to reproduce, but basically it triggers when the top line is smooth scrolled, and second line is more than one physical line tall. Most of the reasons why they are broken is because `reset_skipcol()` or `redraw_later()` aren't called in the right place, so this change will make sure to call them appropriately. --- Second, zb/zz currently will not utilize 'smoothscroll' in a satisfactory fashion. If 'smoothscroll'/'wrap' are set, we should be able to accurate put the current line at the bottom/middle of the screen by smooth-scrolling a long wrapped line at the top of the screen. This change will make those two commands do that. --- Also, add tests to regression test these features.
|
Also, I think Ideally, when we have |
Codecov Report
@@ Coverage Diff @@
## master #11764 +/- ##
=======================================
Coverage 81.90% 81.91%
=======================================
Files 164 164
Lines 191923 191986 +63
Branches 43556 43569 +13
=======================================
+ Hits 157201 157269 +68
+ Misses 21974 21962 -12
- Partials 12748 12755 +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. |
|
This commit does two things:
---
First, existing zt/zb/zz implementation is buggy when 'smoothscroll' are
'wrap' are set. They can lead to inconsistency bugs with regarding to
repainting and cursor states.
For zz, if the user uses `zz` whenever the top line is smooth-scrolled,
the resulting draw will be wrong. For zt, if the line above the current
line is super long (meaning it is so long that the wrapped line covers
more than the entire screen), it will lead to the cursor being in a bad
state. For zb, the exact conditions are harder to reproduce, but
basically it triggers when the top line is smooth scrolled, and second
line is more than one physical line tall.
Most of the reasons why they are broken is because `reset_skipcol()` or
`redraw_later()` aren't called in the right place, so this change will
make sure to call them appropriately.
---
Second, zb/zz currently will not utilize 'smoothscroll' in a
satisfactory fashion. If 'smoothscroll'/'wrap' are set, we should be
able to accurate put the current line at the bottom/middle of the screen
by smooth-scrolling a long wrapped line at the top of the screen. This
change will make those two commands do that.
---
Also, add tests to regression test these features.
Thanks. The 'smoothscroll' implementation is tricky, there is quite a
bit of interference with other options and features. We'll just have to
find and fix the problems over time.
…--
Violators can be fined, arrested or jailed for making ugly faces at a dog.
[real standing law in Oklahoma, United States of America]
/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
…othscroll'
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes vim/vim#11764)
vim/vim@db4d88c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit does two things:
First, existing zt/zb/zz implementation is buggy when 'smoothscroll' are 'wrap' are set. They can lead to inconsistency bugs with regarding to repainting and cursor states.
For zz, if the user uses
zzwhenever the top line is smooth-scrolled, the resulting draw will be wrong. For zt, if the line above the current line is super long (meaning it is so long that the wrapped line covers more than the entire screen), it will lead to the cursor being in a bad state. For zb, the exact conditions are harder to reproduce, but basically it triggers when the top line is smooth scrolled, and second line is more than one physical line tall.Most of the reasons why they are broken is because
reset_skipcol()orredraw_later()aren't called in the right place, so this change will make sure to call them appropriately.Second, zb/zz currently will not utilize 'smoothscroll' in a satisfactory fashion. If 'smoothscroll'/'wrap' are set, we should be able to accurate put the current line at the bottom/middle of the screen by smooth-scrolling a long wrapped line at the top of the screen. This change will make those two commands do that.
Also, add tests to regression test these features.