diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-01-08 18:25:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-08 18:25:52 +0100 |
commit | c4acbb87babf9c06198e56d85d113067fd705795 (patch) | |
tree | dd881a61c8c515600b201ed2685ec6ae591f42f9 /test/functional | |
parent | fbe40caa7cc1786dc58210a82901307417ba0654 (diff) | |
parent | aeb053907d2f27713764e345b00a6618e23220d8 (diff) | |
download | rneovim-c4acbb87babf9c06198e56d85d113067fd705795.tar.gz rneovim-c4acbb87babf9c06198e56d85d113067fd705795.tar.bz2 rneovim-c4acbb87babf9c06198e56d85d113067fd705795.zip |
Merge pull request #26872 from bfredl/fillschar
refactor(options): use schar_T for fillchars and listchars
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/options/chars_spec.lua | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/test/functional/options/chars_spec.lua b/test/functional/options/chars_spec.lua index 3e43fbbecd..d23dc2ed88 100644 --- a/test/functional/options/chars_spec.lua +++ b/test/functional/options/chars_spec.lua @@ -6,6 +6,7 @@ local eq = helpers.eq local exc_exec = helpers.exc_exec local insert = helpers.insert local feed = helpers.feed +local meths = helpers.meths describe("'fillchars'", function() local screen @@ -53,10 +54,18 @@ describe("'fillchars'", function() ]]) end) + it('supports composing multibyte char', function() + command('set fillchars=eob:å̲') + screen:expect([[ + ^ | + å̲ |*3 + | + ]]) + end) + it('handles invalid values', function() shouldfail('eob:') -- empty string shouldfail('eob:馬') -- doublewidth char - shouldfail('eob:å̲') -- composing chars shouldfail('eob:xy') -- two ascii chars shouldfail('eob:\255', 'eob:<ff>') -- invalid UTF-8 end) @@ -178,4 +187,28 @@ describe("'listchars'", function() | ]]) end) + + it('supports composing chars', function() + screen:set_default_attr_ids { + [1] = { foreground = Screen.colors.Blue1, bold = true }, + } + feed('i<tab><tab><tab>x<esc>') + command('set list laststatus=0') + -- tricky: the tab value forms three separate one-cell chars, + -- thus it should be accepted despite being a mess. + command('set listchars=tab:d̞̄̃̒̉̎ò́̌̌̂̐l̞̀̄̆̌̚,eol:å̲') + screen:expect([[ + {1:d̞̄̃̒̉̎ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐l̞̀̄̆̌̚d̞̄̃̒̉̎ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐l̞̀̄̆̌̚d̞̄̃̒̉̎ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐l̞̀̄̆̌̚}^x{1:å̲} | + {1:~ }|*3 + | + ]]) + + meths._invalidate_glyph_cache() + screen:_reset() + screen:expect([[ + {1:d̞̄̃̒̉̎ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐l̞̀̄̆̌̚d̞̄̃̒̉̎ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐l̞̀̄̆̌̚d̞̄̃̒̉̎ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐l̞̀̄̆̌̚}^x{1:å̲} | + {1:~ }|*3 + | + ]]) + end) end) |