aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/ui/diff_spec.lua16
-rw-r--r--test/old/testdir/test_diffmode.vim5
2 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua
index 223622eb6b..21174eaa45 100644
--- a/test/functional/ui/diff_spec.lua
+++ b/test/functional/ui/diff_spec.lua
@@ -2485,6 +2485,22 @@ it('diff mode inline highlighting', function()
command('windo set iskeyword& | 1wincmd w')
+ screen:try_resize(75, 20)
+ command('wincmd =')
+ -- word diff: test handling of multi-byte characters. Only alphanumeric chars
+ -- (e.g. Greek alphabet, but not CJK/emoji) count as words.
+ WriteDiffFiles(
+ '🚀⛵️一二三ひらがなΔέλτα Δelta foobar',
+ '🚀🛸一二四ひらなδέλτα δelta foobar'
+ )
+ command('set diffopt=internal,filler diffopt+=inline:word')
+ screen:expect([[
+ {7: }{4:^🚀}{27:⛵️}{4:一二}{27:三}{4:ひら}{100:が}{4:な}{27:Δέλτα}{4: }{27:Δelta}{4: fooba}│{7: }{4:🚀}{27:🛸}{4:一二}{27:四}{4:ひらな}{27:δέλτα}{4: }{27:δelta}{4: foobar }|
+ {1:~ }│{1:~ }|*17
+ {3:Xdifile1 }{2:Xdifile2 }|
+ |
+ ]])
+
screen:try_resize(69, 20)
command('wincmd =')
-- char diff: should slide highlight to whitespace boundary if possible for
diff --git a/test/old/testdir/test_diffmode.vim b/test/old/testdir/test_diffmode.vim
index 6a5054b37b..2d3bcb8234 100644
--- a/test/old/testdir/test_diffmode.vim
+++ b/test/old/testdir/test_diffmode.vim
@@ -2193,6 +2193,11 @@ func Test_diff_inline()
call term_sendkeys(buf, ":windo set iskeyword&\<CR>:1wincmd w\<CR>")
+ " word diff: test handling of multi-byte characters. Only alphanumeric chars
+ " (e.g. Greek alphabet, but not CJK/emoji) count as words.
+ call WriteDiffFiles(buf, ["🚀⛵️一二三ひらがなΔέλτα Δelta foobar"], ["🚀🛸一二四ひらなδέλτα δelta foobar"])
+ call VerifyInternal(buf, "Test_diff_inline_word_03", " diffopt+=inline:word")
+
" char diff: should slide highlight to whitespace boundary if possible for
" better readability (by using forced indent-heuristics). A wrong result
" would be if the highlight is "Bar, prefix". It should be "prefixBar, "