aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/autoload/man.vim1
-rw-r--r--src/nvim/move.c5
-rw-r--r--src/nvim/option.c3
3 files changed, 9 insertions, 0 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim
index 8ca78f2782..1c25368a68 100644
--- a/runtime/autoload/man.vim
+++ b/runtime/autoload/man.vim
@@ -171,6 +171,7 @@ function! s:put_page(page) abort
" badly with our use of $MANWIDTH=9999. Hack around this by using a fixed
" size for those whitespace regions.
silent! keeppatterns keepjumps %s/\s\{999,}/\=repeat(' ', 10)/g
+ 1
lua require("man").highlight_man_page()
setlocal filetype=man
endfunction
diff --git a/src/nvim/move.c b/src/nvim/move.c
index 4a2874abeb..442e5d6dff 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -98,6 +98,11 @@ static void comp_botline(win_T *wp)
static linenr_T last_cursorline = 0;
+void reset_cursorline(void)
+{
+ last_cursorline = 0;
+}
+
// Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is set.
static void redraw_for_cursorline(win_T *wp)
{
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 7cda42ef20..b4ee89d128 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -3705,6 +3705,9 @@ static char *set_bool_option(const int opt_idx, char_u *const varp,
} else if ((int *)varp == &p_lnr) {
// 'langnoremap' -> !'langremap'
p_lrm = !p_lnr;
+ } else if ((int *)varp == &curwin->w_p_cul && !value && old_value) {
+ // 'cursorline'
+ reset_cursorline();
// 'undofile'
} else if ((int *)varp == &curbuf->b_p_udf || (int *)varp == &p_udf) {
// Only take action when the option was set. When reset we do not