diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-12-19 22:46:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-19 22:46:38 +0800 |
commit | 49efdf84139a0c0f7ba0217e5ab665bc4f222206 (patch) | |
tree | d8f1a838e8a3b778208c5eafc9aa2728718d8fb2 | |
parent | 674a20ac479d25b23b6f9e99e277a57d2a9d67bc (diff) | |
download | rneovim-49efdf84139a0c0f7ba0217e5ab665bc4f222206.tar.gz rneovim-49efdf84139a0c0f7ba0217e5ab665bc4f222206.tar.bz2 rneovim-49efdf84139a0c0f7ba0217e5ab665bc4f222206.zip |
test: "diff" flag of 'fillchars' (#26657)
-rw-r--r-- | test/functional/options/chars_spec.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/functional/options/chars_spec.lua b/test/functional/options/chars_spec.lua index 9800a21e60..ad3148d448 100644 --- a/test/functional/options/chars_spec.lua +++ b/test/functional/options/chars_spec.lua @@ -31,6 +31,7 @@ describe("'fillchars'", function() | ]]) end) + it('supports whitespace', function() screen:expect([[ ^ | @@ -43,6 +44,7 @@ describe("'fillchars'", function() |*4 ]]) end) + it('supports multibyte char', function() command('set fillchars=eob:ñ') screen:expect([[ @@ -51,6 +53,7 @@ describe("'fillchars'", function() | ]]) end) + it('handles invalid values', function() shouldfail('eob:') -- empty string shouldfail('eob:馬') -- doublewidth char @@ -59,6 +62,33 @@ describe("'fillchars'", function() shouldfail('eob:\255', 'eob:<ff>') -- invalid UTF-8 end) end) + + it('"diff" flag', function() + screen:try_resize(45, 8) + screen:set_default_attr_ids({ + [1] = {background = Screen.colors.Grey, foreground = Screen.colors.DarkBlue}; + [2] = {background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1}; + [3] = {background = Screen.colors.LightBlue}; + [4] = {reverse = true}; + [5] = {reverse = true, bold = true}; + }) + command('set fillchars=diff:…') + insert('a\nb\nc\nd\ne') + command('vnew') + insert('a\nd\ne\nf') + command('windo diffthis') + screen:expect([[ + {1: }a │{1: }a | + {1: }{2:……………………………………………………}│{1: }{3:b }| + {1: }{2:……………………………………………………}│{1: }{3:c }| + {1: }d │{1: }d | + {1: }e │{1: }^e | + {1: }{3:f }│{1: }{2:……………………………………………………}| + {4:[No Name] [+] }{5:[No Name] [+] }| + | + ]]) + end) + it('has global value', function() screen:try_resize(50, 5) insert("foo\nbar") @@ -72,6 +102,7 @@ describe("'fillchars'", function() | ]]) end) + it('has window-local value', function() screen:try_resize(50, 5) insert("foo\nbar") @@ -85,6 +116,7 @@ describe("'fillchars'", function() | ]]) end) + it('using :set clears window-local value', function() screen:try_resize(50, 5) insert("foo\nbar") @@ -121,6 +153,7 @@ describe("'listchars'", function() | ]]) end) + it('has window-local value', function() feed('i<tab><tab><tab><esc>') command('set list laststatus=0') @@ -133,6 +166,7 @@ describe("'listchars'", function() | ]]) end) + it('using :set clears window-local value', function() feed('i<tab><tab><tab><esc>') command('set list laststatus=0') |