summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-03-09 11:46:15 +0100
committerBram Moolenaar <Bram@vim.org>2019-03-09 11:46:15 +0100
commit8156ed37558231a8167a1a61a147713d84c9af59 (patch)
treebc5a5e5b636c6f4d67e3c18ba07266e648f3f93e /src/screen.c
parentfd731b0e31df9f167098c4a77ff894fea6cb7f5c (diff)
downloadvim-git-8156ed37558231a8167a1a61a147713d84c9af59.tar.gz
patch 8.1.1001: Visual area not correct when using 'cursorline'v8.1.1001
Problem: Visual area not correct when using 'cursorline'. Solution: Update w_last_cursorline also in Visual mode. (Hirohito Higashi, closes #4086)
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/screen.c b/src/screen.c
index eabf7c186..111c77d8a 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -3704,14 +3704,16 @@ win_line(
#endif
#ifdef FEAT_SYN_HL
- /* Cursor line highlighting for 'cursorline' in the current window. Not
- * when Visual mode is active, because it's not clear what is selected
- * then. */
- if (wp->w_p_cul && lnum == wp->w_cursor.lnum
- && !(wp == curwin && VIsual_active))
+ // Cursor line highlighting for 'cursorline' in the current window.
+ if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
{
- line_attr = HL_ATTR(HLF_CUL);
- area_highlighting = TRUE;
+ // Do not show the cursor line when Visual mode is active, because it's
+ // not clear what is selected then. Do update w_last_cursorline.
+ if (!(wp == curwin && VIsual_active))
+ {
+ line_attr = HL_ATTR(HLF_CUL);
+ area_highlighting = TRUE;
+ }
wp->w_last_cursorline = wp->w_cursor.lnum;
}
#endif