diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2021-07-30 10:49:42 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2021-08-02 05:41:17 +0800 |
| commit | 1666fe9dfe08201c92271b7a59fb2f96a20eb8db (patch) | |
| tree | 4d1f9d0e574a13bf9e7c15a9ab2c30969713da2b /src/nvim/testdir | |
| parent | 337b1b31ac12ee4351668e32fe116282efd3dcc3 (diff) | |
| download | rneovim-1666fe9dfe08201c92271b7a59fb2f96a20eb8db.tar.gz rneovim-1666fe9dfe08201c92271b7a59fb2f96a20eb8db.tar.bz2 rneovim-1666fe9dfe08201c92271b7a59fb2f96a20eb8db.zip | |
vim-patch:8.1.2029: cannot control 'cursorline' highlighting well
Problem: Cannot control 'cursorline' highlighting well.
Solution: Add "screenline". (Christian Brabandt, closes vim/vim#4933)
https://github.com/vim/vim/commit/017ba07fa2cdc578245618717229444fd50c470d
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_cursorline.vim | 94 |
1 files changed, 92 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_cursorline.vim b/src/nvim/testdir/test_cursorline.vim index 46fbd0cd64..49df94f906 100644 --- a/src/nvim/testdir/test_cursorline.vim +++ b/src/nvim/testdir/test_cursorline.vim @@ -1,7 +1,7 @@ " Test for cursorline and cursorlineopt -" -source view_util.vim + source check.vim +source screendump.vim function! s:screen_attr(lnum) abort return map(range(1, 8), 'screenattr(a:lnum, v:val)') @@ -106,3 +106,93 @@ func Test_cursorline_highlight2() exe 'hi' save_hi endtry endfunc + +func Test_cursorline_screenline() + CheckScreendump + CheckOption cursorlineopt + let filename='Xcursorline' + let lines = [] + + let file_content =<< trim END + 1 foooooooo ar einszwei drei vier fünf sechs sieben acht un zehn elf zwöfl dreizehn v ierzehn fünfzehn + 2 foooooooo bar eins zwei drei vier fünf sechs sieben + 3 foooooooo bar eins zwei drei vier fünf sechs sieben + 4 foooooooo bar eins zwei drei vier fünf sechs sieben + END + let lines1 =<< trim END1 + set nocp + set display=lastline + set cursorlineopt=screenline cursorline nu wrap sbr=> + hi CursorLineNr ctermfg=blue + 25vsp + END1 + let lines2 =<< trim END2 + call cursor(1,1) + END2 + call extend(lines, lines1) + call extend(lines, ["call append(0, ".. string(file_content).. ')']) + call extend(lines, lines2) + call writefile(lines, filename) + " basic test + let buf = RunVimInTerminal('-S '. filename, #{rows: 20}) + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_1', {}) + call term_sendkeys(buf, "fagj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_2', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_3', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_4', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_5', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_6', {}) + " test with set list and cursorlineopt containing number + call term_sendkeys(buf, "gg0") + call term_sendkeys(buf, ":set list cursorlineopt+=number listchars=space:-\<cr>") + call VerifyScreenDump(buf, 'Test_'. filename. '_7', {}) + call term_sendkeys(buf, "fagj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_8', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_9', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_10', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_11', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_12', {}) + if exists("+foldcolumn") && exists("+signcolumn") && exists("+breakindent") + " test with set foldcolumn signcoloumn and breakindent + call term_sendkeys(buf, "gg0") + call term_sendkeys(buf, ":set breakindent foldcolumn=2 signcolumn=yes\<cr>") + call VerifyScreenDump(buf, 'Test_'. filename. '_13', {}) + call term_sendkeys(buf, "fagj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_14', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_15', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_16', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_17', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_18', {}) + endif + + call StopVimInTerminal(buf) + call delete(filename) +endfunc |