diff options
Diffstat (limited to 'test/functional/legacy/listchars_spec.lua')
-rw-r--r-- | test/functional/legacy/listchars_spec.lua | 127 |
1 files changed, 125 insertions, 2 deletions
diff --git a/test/functional/legacy/listchars_spec.lua b/test/functional/legacy/listchars_spec.lua index dc6ccd3628..a9aa238d4e 100644 --- a/test/functional/legacy/listchars_spec.lua +++ b/test/functional/legacy/listchars_spec.lua @@ -1,7 +1,8 @@ -- Tests for 'listchars' display with 'list' and :list. local helpers = require('test.functional.helpers')(after_each) -local feed, insert, source = helpers.feed, helpers.insert, helpers.source +local Screen = require('test.functional.ui.screen') +local feed, insert, exec = helpers.feed, helpers.insert, helpers.exec local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers.expect -- luacheck: ignore 621 (Indentation) @@ -13,7 +14,7 @@ describe("'listchars'", function() -- luacheck: ignore 613 (Trailing whitespace in a string) it("works with 'list'", function() - source([[ + exec([[ function GetScreenCharsForLine(lnum) return join(map(range(1, virtcol('$')), 'nr2char(screenchar(a:lnum, v:val))'), '') endfunction @@ -98,4 +99,126 @@ describe("'listchars'", function() .....h>-$ iii<<<<><<$]]) end) + + it('"exceeds" character does not appear in foldcolumn vim-patch:8.2.3121', function() + local screen = Screen.new(60, 10) + screen:set_default_attr_ids({ + [1] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [2] = {bold = true, reverse = true}, -- StatusLine + [3] = {reverse = true}, -- StatusLineNC + [4] = {background = Screen.colors.Grey, foreground = Screen.colors.DarkBlue}, -- FoldColumn, SignColumn + }) + screen:attach() + exec([[ + call setline(1, ['aaa', '', 'a', 'aaaaaa']) + vsplit + vsplit + windo set signcolumn=yes foldcolumn=1 winminwidth=0 nowrap list listchars=extends:>,precedes:< + ]]) + feed('13<C-W>>') + screen:expect([[ + {4: }aaa │{4: }a{1:>}│{4: }^aaa | + {4: } │{4: } │{4: } | + {4: }a │{4: }a │{4: }a | + {4: }aaaaaa │{4: }a{1:>}│{4: }aaaaaa | + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {3:[No Name] [+] <[+] }{2:[No Name] [+] }| + | + ]]) + feed('<C-W>>') + screen:expect([[ + {4: }aaa │{4: }{1:>}│{4: }^aaa | + {4: } │{4: } │{4: } | + {4: }a │{4: }a│{4: }a | + {4: }aaaaaa │{4: }{1:>}│{4: }aaaaaa | + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {3:[No Name] [+] <+] }{2:[No Name] [+] }| + | + ]]) + feed('<C-W>>') + screen:expect([[ + {4: }aaa │{4: }│{4: }^aaa | + {4: } │{4: }│{4: } | + {4: }a │{4: }│{4: }a | + {4: }aaaaaa │{4: }│{4: }aaaaaa | + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {3:[No Name] [+] <] }{2:[No Name] [+] }| + | + ]]) + feed('<C-W>>') + screen:expect([[ + {4: }aaa │{4: }│{4: }^aaa | + {4: } │{4: }│{4: } | + {4: }a │{4: }│{4: }a | + {4: }aaaaaa │{4: }│{4: }aaaaaa | + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {3:[No Name] [+] < }{2:[No Name] [+] }| + | + ]]) + feed('<C-W>>') + screen:expect([[ + {4: }aaa │{4: }│{4: }^aaa | + {4: } │{4: }│{4: } | + {4: }a │{4: }│{4: }a | + {4: }aaaaaa │{4: }│{4: }aaaaaa | + {1:~ }│{1:~}│{1:~ }| + {1:~ }│{1:~}│{1:~ }| + {1:~ }│{1:~}│{1:~ }| + {1:~ }│{1:~}│{1:~ }| + {3:[No Name] [+] < }{2:[No Name] [+] }| + | + ]]) + feed('<C-W>h') + feed_command('set nowrap foldcolumn=4') + screen:expect([[ + {4: }aaa │{4: }^aaa │{4: }aaa | + {4: } │{4: } │{4: } | + {4: }a │{4: }a │{4: }a | + {4: }aaaaaa │{4: }aaaaaa │{4: }aaaaaa | + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {3:[No Name] [+] }{2:[No Name] [+] }{3:[No Name] [+] }| + :set nowrap foldcolumn=4 | + ]]) + feed('15<C-W><lt>') + screen:expect([[ + {4: }aaa │{4: }│{4: }aaa | + {4: } │{4: }│{4: } | + {4: }a │{4: }│{4: }a | + {4: }aaaaaa │{4: ^ }│{4: }aaaaaa | + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {1:~ }│{1:~ }│{1:~ }| + {3:[No Name] [+] }{2:<[+] }{3:[No Name] [+] }| + :set nowrap foldcolumn=4 | + ]]) + feed('4<C-W><lt>') + screen:expect([[ + {4: }aaa │{4: }│{4: }aaa | + {4: } │{4: }│{4: } | + {4: }a │{4: }│{4: }a | + {4: }aaaaaa │{4:^ }│{4: }aaaaaa | + {1:~ }│{1:~}│{1:~ }| + {1:~ }│{1:~}│{1:~ }| + {1:~ }│{1:~}│{1:~ }| + {1:~ }│{1:~}│{1:~ }| + {3:[No Name] [+] }{2:< }{3:[No Name] [+] }| + :set nowrap foldcolumn=4 | + ]]) + end) end) |