aboutsummaryrefslogtreecommitdiff
path: root/test/old
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-23 13:44:53 +0800
committerGitHub <noreply@github.com>2023-08-23 13:44:53 +0800
commit99265d099c2c366eea936438734a323d1fb9b341 (patch)
tree32cc38ad61372c1977f7e295c4e6a6a86acad510 /test/old
parent3e80b39a8ef9d33090800642d25fadbd282af337 (diff)
parent908f247c224db88ffd25e207314d41031519b128 (diff)
downloadrneovim-99265d099c2c366eea936438734a323d1fb9b341.tar.gz
rneovim-99265d099c2c366eea936438734a323d1fb9b341.tar.bz2
rneovim-99265d099c2c366eea936438734a323d1fb9b341.zip
Merge pull request #24844 from zeertzjq/vim-9.0.1783
vim-patch:9.0.1783: Display issues with virt text smoothscroll and showbreak
Diffstat (limited to 'test/old')
-rw-r--r--test/old/testdir/test_listlbr.vim47
-rw-r--r--test/old/testdir/test_listlbr_utf8.vim83
2 files changed, 126 insertions, 4 deletions
diff --git a/test/old/testdir/test_listlbr.vim b/test/old/testdir/test_listlbr.vim
index 2e66fd4ccb..9b9bf63864 100644
--- a/test/old/testdir/test_listlbr.vim
+++ b/test/old/testdir/test_listlbr.vim
@@ -14,7 +14,7 @@ function s:screen_lines(lnum, width) abort
endfunction
func s:compare_lines(expect, actual)
- call assert_equal(join(a:expect, "\n"), join(a:actual, "\n"))
+ call assert_equal(a:expect, a:actual)
endfunc
function s:test_windows(...)
@@ -330,4 +330,47 @@ func Test_list_with_tab_and_skipping_first_chars()
\ ]
call s:compare_lines(expect, lines)
call s:close_windows()
-endfu
+endfunc
+
+func Test_ctrl_char_on_wrap_column()
+ call s:test_windows("setl nolbr wrap sbr=")
+ call setline(1, 'aaa' .. repeat("\<C-A>", 150) .. 'bbb')
+ call cursor(1,1)
+ norm! $
+ redraw!
+ let expect=[
+\ '<<<^A^A^A^A^A^A^A^A^',
+\ 'A^A^A^A^A^A^A^A^A^A^',
+\ 'A^A^A^A^A^A^A^A^A^A^',
+\ 'A^A^A^A^A^A^A^A^A^A^',
+\ 'A^A^A^A^A^A^A^A^A^A^',
+\ 'A^A^A^A^A^A^A^A^A^A^',
+\ 'A^A^A^A^A^A^A^A^A^A^',
+\ 'A^A^A^A^A^A^A^A^A^A^',
+\ 'A^A^A^A^A^A^A^A^A^A^',
+\ 'A^Abbb ']
+ let lines = s:screen_lines([1, 10], winwidth(0))
+ call s:compare_lines(expect, lines)
+ call assert_equal(len(expect), winline())
+ call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
+ setl sbr=!!
+ redraw!
+ let expect=[
+\ '!!A^A^A^A^A^A^A^A^A^',
+\ '!!A^A^A^A^A^A^A^A^A^',
+\ '!!A^A^A^A^A^A^A^A^A^',
+\ '!!A^A^A^A^A^A^A^A^A^',
+\ '!!A^A^A^A^A^A^A^A^A^',
+\ '!!A^A^A^A^A^A^A^A^A^',
+\ '!!A^A^A^A^A^A^A^A^A^',
+\ '!!A^A^A^A^A^A^A^A^A^',
+\ '!!A^A^A^A^A^A^A^A^A^',
+\ '!!A^A^A^A^A^A^Abbb ']
+ let lines = s:screen_lines([1, 10], winwidth(0))
+ call s:compare_lines(expect, lines)
+ call assert_equal(len(expect), winline())
+ call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
+ call s:close_windows()
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab
diff --git a/test/old/testdir/test_listlbr_utf8.vim b/test/old/testdir/test_listlbr_utf8.vim
index 15b248964f..1bbbd2d2ae 100644
--- a/test/old/testdir/test_listlbr_utf8.vim
+++ b/test/old/testdir/test_listlbr_utf8.vim
@@ -249,7 +249,6 @@ endfunc
func Test_chinese_char_on_wrap_column()
call s:test_windows("setl nolbr wrap sbr=")
- syntax off
call setline(1, [
\ 'aaaaaaaaaaaaaaaaaaa中'.
\ 'aaaaaaaaaaaaaaaaa中'.
@@ -278,5 +277,85 @@ func Test_chinese_char_on_wrap_column()
\ '中hello ']
let lines = s:screen_lines([1, 10], winwidth(0))
call s:compare_lines(expect, lines)
+ call assert_equal(len(expect), winline())
+ call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
call s:close_windows()
-endfu
+endfunc
+
+func Test_chinese_char_on_wrap_column_sbr()
+ call s:test_windows("setl nolbr wrap sbr=!!!")
+ call setline(1, [
+\ 'aaaaaaaaaaaaaaaaaaa中'.
+\ 'aaaaaaaaaaaaaa中'.
+\ 'aaaaaaaaaaaaaa中'.
+\ 'aaaaaaaaaaaaaa中'.
+\ 'aaaaaaaaaaaaaa中'.
+\ 'aaaaaaaaaaaaaa中'.
+\ 'aaaaaaaaaaaaaa中'.
+\ 'aaaaaaaaaaaaaa中'.
+\ 'aaaaaaaaaaaaaa中'.
+\ 'aaaaaaaaaaaaaa中'.
+\ 'hello'])
+ call cursor(1,1)
+ norm! $
+ redraw!
+ let expect=[
+\ '!!!中aaaaaaaaaaaaaa>',
+\ '!!!中aaaaaaaaaaaaaa>',
+\ '!!!中aaaaaaaaaaaaaa>',
+\ '!!!中aaaaaaaaaaaaaa>',
+\ '!!!中aaaaaaaaaaaaaa>',
+\ '!!!中aaaaaaaaaaaaaa>',
+\ '!!!中aaaaaaaaaaaaaa>',
+\ '!!!中aaaaaaaaaaaaaa>',
+\ '!!!中aaaaaaaaaaaaaa>',
+\ '!!!中hello ']
+ let lines = s:screen_lines([1, 10], winwidth(0))
+ call s:compare_lines(expect, lines)
+ call assert_equal(len(expect), winline())
+ call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
+ call s:close_windows()
+endfunc
+
+func Test_unprintable_char_on_wrap_column()
+ call s:test_windows("setl nolbr wrap sbr=")
+ call setline(1, 'aaa' .. repeat("\uFEFF", 50) .. 'bbb')
+ call cursor(1,1)
+ norm! $
+ redraw!
+ let expect=[
+\ '<<<<feff><feff><feff',
+\ '><feff><feff><feff><',
+\ 'feff><feff><feff><fe',
+\ 'ff><feff><feff><feff',
+\ '><feff><feff><feff><',
+\ 'feff><feff><feff><fe',
+\ 'ff><feff><feff><feff',
+\ '><feff><feff><feff><',
+\ 'feff><feff><feff><fe',
+\ 'ff>bbb ']
+ let lines = s:screen_lines([1, 10], winwidth(0))
+ call s:compare_lines(expect, lines)
+ call assert_equal(len(expect), winline())
+ call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
+ setl sbr=!!
+ redraw!
+ let expect=[
+\ '!!><feff><feff><feff',
+\ '!!><feff><feff><feff',
+\ '!!><feff><feff><feff',
+\ '!!><feff><feff><feff',
+\ '!!><feff><feff><feff',
+\ '!!><feff><feff><feff',
+\ '!!><feff><feff><feff',
+\ '!!><feff><feff><feff',
+\ '!!><feff><feff><feff',
+\ '!!><feff><feff>bbb ']
+ let lines = s:screen_lines([1, 10], winwidth(0))
+ call s:compare_lines(expect, lines)
+ call assert_equal(len(expect), winline())
+ call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
+ call s:close_windows()
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab