aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-04-26 01:55:00 +0200
committerLuuk van Baal <luukvbaal@gmail.com>2023-05-02 13:11:26 +0200
commitbe11f80d018797b514ed7d01cde2e4c8f88cc8d2 (patch)
treee239d828751a6cef04b7906b515e8303891110a5 /src/nvim/option.c
parentfba18a3b62310f4535d979a05288101b9af2ef50 (diff)
downloadrneovim-be11f80d018797b514ed7d01cde2e4c8f88cc8d2.tar.gz
rneovim-be11f80d018797b514ed7d01cde2e4c8f88cc8d2.tar.bz2
rneovim-be11f80d018797b514ed7d01cde2e4c8f88cc8d2.zip
vim-patch:9.0.0640: cannot scroll by screen line if a line wraps
Problem: Cannot scroll by screen line if a line wraps. Solution: Add the 'smoothscroll' option. Only works for CTRL-E and CTRL-Y so far. https://github.com/vim/vim/commit/f6196f424474e2a9c160f2a995fc2691f82b58f9 vim-patch:9.0.0641: missing part of the new option code Problem: Missing part of the new option code. Solution: Add missing WV_SMS. https://github.com/vim/vim/commit/bbbda8fd81f6d720962b67ae885825bad9be4456 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 3264d80a2f..7d705b8502 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -2621,6 +2621,19 @@ static const char *did_set_showtabline(optset_T *args FUNC_ATTR_UNUSED)
return NULL;
}
+/// Process the updated 'smoothscroll' option value.
+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;
+ }
+
+ win->w_skipcol = 0;
+ changed_line_abv_curs_win(win);
+ return NULL;
+}
+
/// Process the new 'foldlevel' option value.
static const char *did_set_foldlevel(optset_T *args FUNC_ATTR_UNUSED)
{
@@ -4417,6 +4430,8 @@ static char *get_varp_from(vimoption_T *p, buf_T *buf, win_T *win)
return (char *)&(win->w_p_rlc);
case PV_SCROLL:
return (char *)&(win->w_p_scr);
+ case PV_SMS:
+ return (char *)&(win->w_p_sms);
case PV_WRAP:
return (char *)&(win->w_p_wrap);
case PV_LBR: