From 010ee9657acf1a9f799079d718998c94e50ccadc Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 25 Sep 2019 20:37:36 +0200 Subject: 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. --- src/testdir/test_highlight.vim | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/testdir/test_highlight.vim') 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, ":\") + 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() -- cgit v1.2.1