+62
-19
lines changedFilter options
+62
-19
lines changed Original file line number Diff line number Diff line change
@@ -1480,8 +1480,6 @@ bool edit(int cmdchar, bool startln, long count)
1480
1480
/// @param ready not busy with something
1481
1481
static void ins_redraw(bool ready)
1482
1482
{
1483
-
bool conceal_cursor_moved = false;
1484
-
1485
1483
if (char_avail()) {
1486
1484
return;
1487
1485
}
@@ -1504,7 +1502,6 @@ static void ins_redraw(bool ready)
1504
1502
update_curswant();
1505
1503
ins_apply_autocmds(EVENT_CURSORMOVEDI);
1506
1504
}
1507
-
conceal_cursor_moved = true;
1508
1505
curwin->w_last_cursormoved = curwin->w_cursor;
1509
1506
}
1510
1507
@@ -1560,11 +1557,6 @@ static void ins_redraw(bool ready)
1560
1557
curbuf->b_changed_invalid = false;
1561
1558
}
1562
1559
1563
-
if (curwin->w_p_cole > 0 && conceal_cursor_line(curwin)
1564
-
&& conceal_cursor_moved) {
1565
-
redrawWinline(curwin, curwin->w_cursor.lnum);
1566
-
}
1567
-
1568
1560
pum_check_clear();
1569
1561
if (must_redraw) {
1570
1562
update_screen(0);
Original file line number Diff line number Diff line change
@@ -96,19 +96,20 @@ static void comp_botline(win_T *wp)
96
96
}
97
97
98
98
/// Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is set.
99
+
/// Also when concealing is on and 'concealcursor' is not active.
99
100
void redraw_for_cursorline(win_T *wp)
100
101
FUNC_ATTR_NONNULL_ALL
101
102
{
102
-
if ((wp->w_p_rnu || win_cursorline_standout(wp))
103
-
&& (wp->w_valid & VALID_CROW) == 0
104
-
&& !pum_visible()) {
103
+
if ((wp->w_valid & VALID_CROW) == 0 && !pum_visible()
104
+
&& (wp->w_p_rnu || win_cursorline_standout(wp))) {
105
105
// win_line() will redraw the number column and cursorline only.
106
106
redraw_later(wp, VALID);
107
107
}
108
108
}
109
109
110
110
/// Redraw when w_virtcol changes and 'cursorcolumn' is set or 'cursorlineopt'
111
111
/// contains "screenline".
112
+
/// Also when concealing is on and 'concealcursor' is active.
112
113
static void redraw_for_cursorcolumn(win_T *wp)
113
114
FUNC_ATTR_NONNULL_ALL
114
115
{
@@ -121,6 +122,12 @@ static void redraw_for_cursorcolumn(win_T *wp)
121
122
redraw_later(wp, VALID);
122
123
}
123
124
}
125
+
// If the cursor moves horizontally when 'concealcursor' is active, then the
126
+
// current line needs to be redrawn in order to calculate the correct
127
+
// cursor position.
128
+
if ((wp->w_valid & VALID_VIRTCOL) == 0 && wp->w_p_cole > 0 && conceal_cursor_line(wp)) {
129
+
redrawWinline(wp, wp->w_cursor.lnum);
130
+
}
124
131
}
125
132
126
133
/*
Original file line number Diff line number Diff line change
@@ -1288,13 +1288,6 @@ static void normal_redraw(NormalState *s)
1288
1288
update_topline(curwin);
1289
1289
validate_cursor();
1290
1290
1291
-
// If the cursor moves horizontally when 'concealcursor' is active, then the
1292
-
// current line needs to be redrawn in order to calculate the correct
1293
-
// cursor position.
1294
-
if (curwin->w_p_cole > 0 && conceal_cursor_line(curwin)) {
1295
-
redrawWinline(curwin, curwin->w_cursor.lnum);
1296
-
}
1297
-
1298
1291
if (VIsual_active) {
1299
1292
update_curbuf(INVERTED); // update inverted part
1300
1293
} else if (must_redraw) {
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ local Screen = require('test.functional.ui.screen')
3
3
local clear, feed, command = helpers.clear, helpers.feed, helpers.command
4
4
local eq = helpers.eq
5
5
local insert = helpers.insert
6
+
local poke_eventloop = helpers.poke_eventloop
6
7
7
8
describe('Screen', function()
8
9
local screen
@@ -911,7 +912,57 @@ describe('Screen', function()
911
912
{0:~ }|
912
913
|
913
914
]]}
914
-
eq(grid_lines, {{2, 0, {{'c', 0, 3}}}})
915
+
eq({{2, 0, {{'c', 0, 3}}}}, grid_lines)
916
+
end)
917
+
918
+
it('K_EVENT should not cause extra redraws with concealcursor #13196', function()
919
+
command('set conceallevel=1')
920
+
command('set concealcursor=nv')
921
+
command('set redrawdebug+=nodelta')
922
+
923
+
insert([[
924
+
aaa
925
+
bbb
926
+
ccc
927
+
]])
928
+
screen:expect{grid=[[
929
+
aaa |
930
+
bbb |
931
+
ccc |
932
+
^ |
933
+
{0:~ }|
934
+
{0:~ }|
935
+
{0:~ }|
936
+
{0:~ }|
937
+
{0:~ }|
938
+
|
939
+
]]}
940
+
941
+
-- XXX: hack to get notifications, and check only a single line is
942
+
-- updated. Could use next_msg() also.
943
+
local orig_handle_grid_line = screen._handle_grid_line
944
+
local grid_lines = {}
945
+
function screen._handle_grid_line(self, grid, row, col, items)
946
+
table.insert(grid_lines, {row, col, items})
947
+
orig_handle_grid_line(self, grid, row, col, items)
948
+
end
949
+
feed('k')
950
+
screen:expect{grid=[[
951
+
aaa |
952
+
bbb |
953
+
^ccc |
954
+
|
955
+
{0:~ }|
956
+
{0:~ }|
957
+
{0:~ }|
958
+
{0:~ }|
959
+
{0:~ }|
960
+
|
961
+
]]}
962
+
eq({{2, 0, {{'c', 0, 3}}}}, grid_lines)
963
+
poke_eventloop() -- causes K_EVENT key
964
+
screen:expect_unchanged()
965
+
eq({{2, 0, {{'c', 0, 3}}}}, grid_lines)
915
966
end)
916
967
917
968
-- Copy of Test_cursor_column_in_concealed_line_after_window_scroll in
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4