diff options
author | Daniel Hahler <git@thequod.de> | 2019-09-26 09:15:21 +0200 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-10-04 08:48:57 +0200 |
commit | a341eb608706e5e8ac691a7e8f4a9d314bafee20 (patch) | |
tree | 2a18de092fab445c378ce157962f6a41c65386f1 /test/functional/ui/syntax_conceal_spec.lua | |
parent | cd73a0342a457c035b84e4406428ac30b30bf754 (diff) | |
download | rneovim-a341eb608706e5e8ac691a7e8f4a9d314bafee20.tar.gz rneovim-a341eb608706e5e8ac691a7e8f4a9d314bafee20.tar.bz2 rneovim-a341eb608706e5e8ac691a7e8f4a9d314bafee20.zip |
win_line: update `w_last_cursorline` always
Vim patch 8.1.0856 (54d9ea6) caused a performance regression in Neovim,
when `set conceallevel=1 nocursorline` was used, since then due to
refactoring in 23c71d5 `w_last_cursorline` would never get updated
anymore.
Adds/uses `redrawdebug+=nodelta` for testing this.
Fixes https://github.com/neovim/neovim/issues/11100.
Closes https://github.com/neovim/neovim/pull/11101.
Diffstat (limited to 'test/functional/ui/syntax_conceal_spec.lua')
-rw-r--r-- | test/functional/ui/syntax_conceal_spec.lua | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua index 7079b43414..566d183f11 100644 --- a/test/functional/ui/syntax_conceal_spec.lua +++ b/test/functional/ui/syntax_conceal_spec.lua @@ -1,6 +1,7 @@ local helpers = require('test.functional.helpers')(after_each) 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 describe('Screen', function() @@ -870,4 +871,50 @@ describe('Screen', function() ]]} end) end) + + it('redraws not too much with conceallevel=1', function() + command('set conceallevel=1') + 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(grid_lines, {{2, 0, {{'c', 0, 3}}}}) + end) end) |