To: vim_dev@googlegroups.com Subject: Patch 8.2.1689 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1689 Problem: 'colorcolumn' doesn't show in indent. Solution: Also draw the column when draw_state is WL_BRI or WL_SBR. (Alexey Demin, closes #6948, closes #6619) Files: src/drawline.c, src/testdir/dumps/Test_colorcolumn_2.dump, src/testdir/dumps/Test_colorcolumn_3.dump, src/testdir/test_highlight.vim *** ../vim-8.2.1688/src/drawline.c 2020-08-31 21:58:36.115898718 +0200 --- src/drawline.c 2020-09-15 20:49:26.233483527 +0200 *************** *** 2775,2782 **** // highlight the cursor position itself. // Also highlight the 'colorcolumn' if it is different than // 'cursorcolumn' vcol_save_attr = -1; ! if (draw_state == WL_LINE && !lnum_in_visual_area && search_attr == 0 && area_attr == 0) { if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol --- 2775,2786 ---- // highlight the cursor position itself. // Also highlight the 'colorcolumn' if it is different than // 'cursorcolumn' + // Also highlight the 'colorcolumn' if 'breakindent' and/or 'showbreak' + // options are set vcol_save_attr = -1; ! if ((draw_state == WL_LINE || ! draw_state == WL_BRI || ! draw_state == WL_SBR) && !lnum_in_visual_area && search_attr == 0 && area_attr == 0) { if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol *** ../vim-8.2.1688/src/testdir/dumps/Test_colorcolumn_2.dump 2020-09-15 20:51:53.245004430 +0200 --- src/testdir/dumps/Test_colorcolumn_2.dump 2020-09-15 20:49:26.233483527 +0200 *************** *** 0 **** --- 1,10 ---- + >T+0&#ffffff0|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|p|e|d| |o|v|e|r| |t|h|e| @3| +0&#ffd7d7255 + @1| +0&#ffffff0|l+0&#ffd7d7255|a+0&#ffffff0|z|y| |d|o|g|s| @28 + |~+0#4040ff13&| @38 + |~| @38 + |~| @38 + |~| @38 + |~| @38 + |~| @38 + |~| @38 + | +0#0000000&@21|1|,|1| @10|A|l@1| *** ../vim-8.2.1688/src/testdir/dumps/Test_colorcolumn_3.dump 2020-09-15 20:51:53.249004414 +0200 --- src/testdir/dumps/Test_colorcolumn_3.dump 2020-09-15 20:49:26.233483527 +0200 *************** *** 0 **** --- 1,10 ---- + >T+0&#ffffff0|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|p|e|d| |o|v|e|r| |t|h|e| |l|a|z|y+0&#ffd7d7255 + |++0#4040ff13&|++0&#ffffff0|++0&#ffd7d7255|>+0&#ffffff0| | +0#0000000&|d|o|g|s| @29 + |~+0#4040ff13&| @38 + |~| @38 + |~| @38 + |~| @38 + |~| @38 + |~| @38 + |~| @38 + | +0#0000000&@21|1|,|1| @10|A|l@1| *** ../vim-8.2.1688/src/testdir/test_highlight.vim 2020-08-12 18:50:31.879655802 +0200 --- src/testdir/test_highlight.vim 2020-09-15 20:49:26.233483527 +0200 *************** *** 662,667 **** --- 662,703 ---- call delete('Xtest_colorcolumn') endfunc + func Test_colorcolumn_bri() + CheckScreendump + + " check 'colorcolumn' when 'breakindent' is set + let lines =<< trim END + call setline(1, 'The quick brown fox jumped over the lazy dogs') + END + call writefile(lines, 'Xtest_colorcolumn_bri') + let buf = RunVimInTerminal('-S Xtest_colorcolumn_bri', {'rows': 10,'columns': 40}) + call term_sendkeys(buf, ":set co=40 linebreak bri briopt=shift:2 cc=40,41,43\") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_colorcolumn_2', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('Xtest_colorcolumn_bri') + endfunc + + func Test_colorcolumn_sbr() + CheckScreendump + + " check 'colorcolumn' when 'showbreak' is set + let lines =<< trim END + call setline(1, 'The quick brown fox jumped over the lazy dogs') + END + call writefile(lines, 'Xtest_colorcolumn_srb') + let buf = RunVimInTerminal('-S Xtest_colorcolumn_srb', {'rows': 10,'columns': 40}) + call term_sendkeys(buf, ":set co=40 showbreak=+++>\\ cc=40,41,43\") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_colorcolumn_3', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('Xtest_colorcolumn_srb') + 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() *** ../vim-8.2.1688/src/version.c 2020-09-15 20:34:04.832428486 +0200 --- src/version.c 2020-09-15 20:50:00.801370977 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 1689, /**/ -- [The rest of the ARMY stand around looking at a loss.] INSPECTOR END OF FILM: (picks up megaphone) All right! Clear off! Go on! "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///