diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-03-31 10:56:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 10:56:15 +0200 |
commit | b2bd8004161853f53bf687b0b90119055fcb5cfb (patch) | |
tree | 61da0ef02bc7dbdfff8e232a9e36efe87676c293 /test | |
parent | 1184097261260e53519db54548acf2c1e5ab7e68 (diff) | |
parent | 595c1a724af9fe93d4ff1df7d5c47e4c9c31a7a6 (diff) | |
download | rneovim-b2bd8004161853f53bf687b0b90119055fcb5cfb.tar.gz rneovim-b2bd8004161853f53bf687b0b90119055fcb5cfb.tar.bz2 rneovim-b2bd8004161853f53bf687b0b90119055fcb5cfb.zip |
Merge pull request #17890 from zeertzjq/conceal-virtcol-changed
perf: only redraw concealed line if cursor has moved horizontally
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/syntax_conceal_spec.lua | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua index 4e1852162f..92e5a5dd94 100644 --- a/test/functional/ui/syntax_conceal_spec.lua +++ b/test/functional/ui/syntax_conceal_spec.lua @@ -3,6 +3,7 @@ local Screen = require('test.functional.ui.screen') local clear, feed, command = helpers.clear, helpers.feed, helpers.command local eq = helpers.eq local insert = helpers.insert +local poke_eventloop = helpers.poke_eventloop describe('Screen', function() local screen @@ -911,7 +912,57 @@ describe('Screen', function() {0:~ }| | ]]} - eq(grid_lines, {{2, 0, {{'c', 0, 3}}}}) + eq({{2, 0, {{'c', 0, 3}}}}, grid_lines) + end) + + it('K_EVENT should not cause extra redraws with concealcursor #13196', function() + command('set conceallevel=1') + command('set concealcursor=nv') + command('set redrawdebug+=nodelta') + + insert([[ + aaa + bbb + ccc + ]]) + screen:expect{grid=[[ + aaa | + bbb | + ccc | + ^ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]} + + -- XXX: hack to get notifications, and check only a single line is + -- updated. Could use next_msg() also. + local orig_handle_grid_line = screen._handle_grid_line + local grid_lines = {} + function screen._handle_grid_line(self, grid, row, col, items) + table.insert(grid_lines, {row, col, items}) + orig_handle_grid_line(self, grid, row, col, items) + end + feed('k') + screen:expect{grid=[[ + aaa | + bbb | + ^ccc | + | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]} + eq({{2, 0, {{'c', 0, 3}}}}, grid_lines) + poke_eventloop() -- causes K_EVENT key + screen:expect_unchanged() + eq({{2, 0, {{'c', 0, 3}}}}, grid_lines) end) -- Copy of Test_cursor_column_in_concealed_line_after_window_scroll in |