aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer_defs.h
diff options
context:
space:
mode:
authorluukvbaal <31730729+luukvbaal@users.noreply.github.com>2023-02-14 08:52:22 +0100
committerGitHub <noreply@github.com>2023-02-14 15:52:22 +0800
commit53968082675cd3b8d1809e53a47c0311b7347ef9 (patch)
tree21df9c0a71da05b9c6d189ee5a42ebc4267ed1b2 /src/nvim/buffer_defs.h
parent20c9f4b3521fa7ab5c5997c0ec1a3df2b5bd0dbe (diff)
downloadrneovim-53968082675cd3b8d1809e53a47c0311b7347ef9.tar.gz
rneovim-53968082675cd3b8d1809e53a47c0311b7347ef9.tar.bz2
rneovim-53968082675cd3b8d1809e53a47c0311b7347ef9.zip
fix(folds): cursorline highlight is not always applied on closed folds (#22242)
Problem: The cursorline highlight logic checks for `w_cursor.lnum` which may be different from the line number passed to `win_line()` even when the cursor is actually on that line. Solution: Update cursor line highlight logic to check for the line number of the start of a closed fold if necessary.
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r--src/nvim/buffer_defs.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index 3601dc7062..cace4b1364 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -1112,20 +1112,23 @@ struct window_S {
win_T *w_prev; ///< link to previous window
win_T *w_next; ///< link to next window
bool w_closing; ///< window is being closed, don't let
- /// autocommands close it too.
+ ///< autocommands close it too.
frame_T *w_frame; ///< frame containing this window
pos_T w_cursor; ///< cursor position in buffer
colnr_T w_curswant; ///< Column we want to be at. This is
- /// used to try to stay in the same column
- /// for up/down cursor motions.
+ ///< used to try to stay in the same column
+ ///< for up/down cursor motions.
int w_set_curswant; // If set, then update w_curswant the next
// time through cursupdate() to the
// current virtual column
+ linenr_T w_cursorline; ///< Where 'cursorline' should be drawn,
+ ///< can be different from w_cursor.lnum
+ ///< for closed folds.
linenr_T w_last_cursorline; ///< where last 'cursorline' was drawn
pos_T w_last_cursormoved; ///< for CursorMoved event