summaryrefslogtreecommitdiff
path: root/src/testdir/test_highlight.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-25 20:37:36 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-25 20:37:36 +0200
commit010ee9657acf1a9f799079d718998c94e50ccadc (patch)
treee69265142e192956576867020a98d2f58523edd9 /src/testdir/test_highlight.vim
parent03ac52fc025790c474030ea556cec799400aa046 (diff)
downloadvim-git-010ee9657acf1a9f799079d718998c94e50ccadc.tar.gz
patch 8.1.2073: when editing a buffer 'colorcolumn' may not workv8.1.2073
Problem: When editing a buffer 'colorcolumn' may not work. Solution: Set the buffer before copying option values. Call check_colorcolumn() after copying window options.
Diffstat (limited to 'src/testdir/test_highlight.vim')
-rw-r--r--src/testdir/test_highlight.vim25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/testdir/test_highlight.vim b/src/testdir/test_highlight.vim
index 7db33bf30..9e1af9730 100644
--- a/src/testdir/test_highlight.vim
+++ b/src/testdir/test_highlight.vim
@@ -618,6 +618,31 @@ func Test_wincolor()
call delete('Xtest_wincolor')
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
+
" This test must come before the Test_cursorline test, as it appears this
" defines the Normal highlighting group anyway.
func Test_1_highlight_Normalgroup_exists()