mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 9.0.2081: smoothscroll may result in wrong cursor position
Problem: With 'smoothscroll' set, "w_skipcol" is not reset when unsetting 'wrap'. Resulting in incorrect calculation of the cursor position. Solution: Reset "w_skipcol" when unsetting 'wrap'. fixes: #12970 closes: #13439 Signed-off-by: Luuk van Baal <luukvbaal@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
a390e984db
commit
1bf1bf569b
11
src/option.c
11
src/option.c
@@ -4081,11 +4081,9 @@ did_set_showtabline(optset_T *args UNUSED)
|
||||
char *
|
||||
did_set_smoothscroll(optset_T *args UNUSED)
|
||||
{
|
||||
if (curwin->w_p_sms)
|
||||
return NULL;
|
||||
if (!curwin->w_p_sms)
|
||||
curwin->w_skipcol = 0;
|
||||
|
||||
curwin->w_skipcol = 0;
|
||||
changed_line_abv_curs();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -4535,9 +4533,12 @@ did_set_winwidth(optset_T *args UNUSED)
|
||||
char *
|
||||
did_set_wrap(optset_T *args UNUSED)
|
||||
{
|
||||
// If 'wrap' is set, set w_leftcol to zero.
|
||||
// Set w_leftcol or w_skipcol to zero.
|
||||
if (curwin->w_p_wrap)
|
||||
curwin->w_leftcol = 0;
|
||||
else
|
||||
curwin->w_skipcol = 0;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user