diff options
author | Michael Vilim <697a9b924bfa6f06a81e82975ddca4785b90a7b40d91044ce76f68d3bd65a9b8@697a9b924bfa6f06a81e82975ddca4785b90a7b40d91044ce76f68d3bd65a9b8.com> | 2019-01-09 11:42:50 -0600 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-01-11 01:44:15 +0100 |
commit | bed95b37b29889d1d0edbcb70fd0bf6814d9a574 (patch) | |
tree | a4f01b2c2d382b682a38156900933f752101af46 /test/functional/ui/fold_spec.lua | |
parent | 3f10c5b5338fc7efec53a23427e1c0e2dea56be4 (diff) | |
download | rneovim-bed95b37b29889d1d0edbcb70fd0bf6814d9a574.tar.gz rneovim-bed95b37b29889d1d0edbcb70fd0bf6814d9a574.tar.bz2 rneovim-bed95b37b29889d1d0edbcb70fd0bf6814d9a574.zip |
vim-patch:8.1.0449: fix display of 'rnu' with folded lines #9481
Problem: When 'rnu' is set folded lines are not displayed correctly.
(Vitaly Yashin)
Solution: When only redrawing line numbers do draw folded lines.
(closes vim/vim#3484)
https://github.com/vim/vim/commit/7701f308565fdc7b5096a6597d9c3b63de0bbcec
---
Explanation:
Before this patch, relative line numbers would update on a cursor
movement and overwrite fold highlighting in the line number columns.
Other operations can cause the fold highlighting to overwrite the line
number styles. Together, this causes the highlighting in the line number
columns to flicker back and forth while editing.
Test case: create `t.vim` with these contents:
set fdm=marker rnu foldcolumn=2
call setline(1, ["{{{1", "nline 1", "{{{1", "line 2"])
and then call `nvim -u NORC -S t.vim` and press `j`; observe that the fold
highlighting disappears.
Diffstat (limited to 'test/functional/ui/fold_spec.lua')
-rw-r--r-- | test/functional/ui/fold_spec.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua index 39a5c10bb7..943cbcef56 100644 --- a/test/functional/ui/fold_spec.lua +++ b/test/functional/ui/fold_spec.lua @@ -1,8 +1,10 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear, feed, eq = helpers.clear, helpers.feed, helpers.eq +local command = helpers.command local feed_command = helpers.feed_command local insert = helpers.insert +local funcs = helpers.funcs local meths = helpers.meths describe("folded lines", function() @@ -26,6 +28,26 @@ describe("folded lines", function() screen:detach() end) + it("highlighting with relative line numbers", function() + command("set relativenumber foldmethod=marker") + feed_command("set foldcolumn=2") + funcs.setline(1, '{{{1') + funcs.setline(2, 'line 1') + funcs.setline(3, '{{{1') + funcs.setline(4, 'line 2') + feed("j") + screen:expect([[ + {7:+ }{5: 1 +-- 2 lines: ·························}| + {7:+ }{5: 0 ^+-- 2 lines: ·························}| + {7: }{1:~ }| + {7: }{1:~ }| + {7: }{1:~ }| + {7: }{1:~ }| + {7: }{1:~ }| + :set foldcolumn=2 | + ]]) + end) + it("works with multibyte text", function() -- Currently the only allowed value of 'maxcombine' eq(6, meths.get_option('maxcombine')) |