aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2023-10-29 00:05:29 +0200
committerGitHub <noreply@github.com>2023-10-29 06:05:29 +0800
commitf2fb05238ad55586e26289a27f2af519e24f94f5 (patch)
treed9735c615487bceb2c75645ced5e46441ff705e8 /src
parent4f526b9fd864acbba9665e5a71787fc1c958d82c (diff)
downloadrneovim-f2fb05238ad55586e26289a27f2af519e24f94f5.tar.gz
rneovim-f2fb05238ad55586e26289a27f2af519e24f94f5.tar.bz2
rneovim-f2fb05238ad55586e26289a27f2af519e24f94f5.zip
vim-patch:9.0.2081: smoothscroll may result in wrong cursor position (#25815)
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: vim/vim#12970 closes: vim/vim#13439 https://github.com/vim/vim/commit/1bf1bf569b96d2f9b28e0cce0968ffbf2fb80aac
Diffstat (limited to 'src')
-rw-r--r--src/nvim/option.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index a9916dc28c..2582e77662 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -2534,12 +2534,10 @@ static const char *did_set_showtabline(optset_T *args FUNC_ATTR_UNUSED)
static const char *did_set_smoothscroll(optset_T *args FUNC_ATTR_UNUSED)
{
win_T *win = (win_T *)args->os_win;
- if (win->w_p_sms) {
- return NULL;
+ if (!win->w_p_sms) {
+ win->w_skipcol = 0;
}
- win->w_skipcol = 0;
- changed_line_abv_curs_win(win);
return NULL;
}
@@ -2746,11 +2744,13 @@ static const char *did_set_winwidth(optset_T *args)
static const char *did_set_wrap(optset_T *args)
{
win_T *win = (win_T *)args->os_win;
-
- // If 'wrap' is set, set w_leftcol to zero.
+ // Set w_leftcol or w_skipcol to zero.
if (win->w_p_wrap) {
win->w_leftcol = 0;
+ } else {
+ win->w_skipcol = 0;
}
+
return NULL;
}
/// Check the bounds of numeric options.