summaryrefslogtreecommitdiffstats
path: root/src/option.c
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-10-28 21:43:31 +0200
committerChristian Brabandt <cb@256bit.org>2023-10-28 21:43:31 +0200
commit1bf1bf569b96d2f9b28e0cce0968ffbf2fb80aac (patch)
tree72b7fdecf5faca63e5dd71e6506bce076b44ca43 /src/option.c
parenta390e984db20575dc726b4e0ebf95582265df8e7 (diff)
patch 9.0.2081: smoothscroll may result in wrong cursor positionv9.0.2081
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>
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/option.c b/src/option.c
index 180aca221d..35529a576e 100644
--- a/src/option.c
+++ b/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;
}