aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-02-12 06:36:17 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-02-12 06:36:17 +0800
commit612696bedc8f178cb08645dfb056f01efacf5122 (patch)
tree09809dd00e555589c47457c7eb9c8b3f2d7fc3e7 /src/nvim/testdir
parent906182065bd73e4fbedeecc347ea8c8647c3304f (diff)
downloadrneovim-612696bedc8f178cb08645dfb056f01efacf5122.tar.gz
rneovim-612696bedc8f178cb08645dfb056f01efacf5122.tar.bz2
rneovim-612696bedc8f178cb08645dfb056f01efacf5122.zip
vim-patch:8.1.2073: when editing a buffer 'colorcolumn' may not work
Problem: When editing a buffer 'colorcolumn' may not work. Solution: Set the buffer before copying option values. Call check_colorcolumn() after copying window options. https://github.com/vim/vim/commit/010ee9657acf1a9f799079d718998c94e50ccadc
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_highlight.vim25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_highlight.vim b/src/nvim/testdir/test_highlight.vim
index 899eb530ec..6971ecd357 100644
--- a/src/nvim/testdir/test_highlight.vim
+++ b/src/nvim/testdir/test_highlight.vim
@@ -597,6 +597,31 @@ func Test_cursorline_with_visualmode()
call delete('Xtest_cursorline_with_visualmode')
endfunc
+func Test_colorcolumn()
+ CheckScreendump
+
+ " check that setting 'colorcolumn' when entering a buffer works
+ let lines =<< trim END
+ split
+ edit X
+ call setline(1, ["1111111111","22222222222","3333333333"])
+ set nomodified
+ set colorcolumn=3,9
+ set number cursorline cursorlineopt=number
+ wincmd w
+ buf X
+ END
+ call writefile(lines, 'Xtest_colorcolumn')
+ let buf = RunVimInTerminal('-S Xtest_colorcolumn', {'rows': 10})
+ call term_sendkeys(buf, ":\<CR>")
+ call term_wait(buf)
+ call VerifyScreenDump(buf, 'Test_colorcolumn_1', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('Xtest_colorcolumn')
+endfunc
+
func Test_colorcolumn_bri()
CheckScreendump