Mercurial > vim
comparison src/drawline.c @ 28177:f04a3ec65e2d v8.2.4614
patch 8.2.4614: redrawing too much when 'cursorline' is set
Commit: https://github.com/vim/vim/commit/c20e46a4e3efcd408ef132872238144ea34f7ae5
Author: zeertzjq <zeertzjq@outlook.com>
Date: Wed Mar 23 14:55:23 2022 +0000
patch 8.2.4614: redrawing too much when 'cursorline' is set
Problem: Redrawing too much when 'cursorline' is set and jumping around.
Solution: Rely on win_update() to redraw the current and previous cursor
line, do not mark lines as modified. (closes #9996)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 23 Mar 2022 16:00:03 +0100 |
parents | bef82285dda0 |
children | d770568e6c98 |
comparison
equal
deleted
inserted
replaced
28176:a394011bde90 | 28177:f04a3ec65e2d |
---|---|
943 #ifdef FEAT_SYN_HL | 943 #ifdef FEAT_SYN_HL |
944 // Cursor line highlighting for 'cursorline' in the current window. | 944 // Cursor line highlighting for 'cursorline' in the current window. |
945 if (wp->w_p_cul && lnum == wp->w_cursor.lnum) | 945 if (wp->w_p_cul && lnum == wp->w_cursor.lnum) |
946 { | 946 { |
947 // Do not show the cursor line in the text when Visual mode is active, | 947 // Do not show the cursor line in the text when Visual mode is active, |
948 // because it's not clear what is selected then. Do update | 948 // because it's not clear what is selected then. |
949 // w_last_cursorline. | |
950 if (!(wp == curwin && VIsual_active) | 949 if (!(wp == curwin && VIsual_active) |
951 && wp->w_p_culopt_flags != CULOPT_NBR) | 950 && wp->w_p_culopt_flags != CULOPT_NBR) |
952 { | 951 { |
953 cul_screenline = (wp->w_p_wrap | 952 cul_screenline = (wp->w_p_wrap |
954 && (wp->w_p_culopt_flags & CULOPT_SCRLINE)); | 953 && (wp->w_p_culopt_flags & CULOPT_SCRLINE)); |
969 line_attr = hl_combine_attr(line_attr, cul_attr); | 968 line_attr = hl_combine_attr(line_attr, cul_attr); |
970 } | 969 } |
971 else | 970 else |
972 # endif | 971 # endif |
973 line_attr = cul_attr; | 972 line_attr = cul_attr; |
974 wp->w_last_cursorline = wp->w_cursor.lnum; | |
975 } | 973 } |
976 else | 974 else |
977 { | 975 { |
978 line_attr_save = line_attr; | 976 line_attr_save = line_attr; |
979 wp->w_last_cursorline = 0; | |
980 margin_columns_win(wp, &left_curline_col, &right_curline_col); | 977 margin_columns_win(wp, &left_curline_col, &right_curline_col); |
981 } | 978 } |
982 area_highlighting = TRUE; | 979 area_highlighting = TRUE; |
983 } | 980 } |
984 else | |
985 wp->w_last_cursorline = wp->w_cursor.lnum; | |
986 } | 981 } |
987 #endif | 982 #endif |
988 | 983 |
989 #ifdef FEAT_PROP_POPUP | 984 #ifdef FEAT_PROP_POPUP |
990 { | 985 { |