To: vim_dev@googlegroups.com Subject: Patch 8.1.2245 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2245 Problem: Third character of 'listchars' tab shows in wrong place when 'breakindent' is set. Solution: Set c_final to NUL. (Naruhiko Nishino, closes #5165) Files: src/drawline.c, src/testdir/test_breakindent.vim *** ../vim-8.1.2244/src/drawline.c 2019-11-02 22:00:10.774005213 +0100 --- src/drawline.c 2019-11-03 15:41:51.767692230 +0100 *************** *** 1173,1178 **** --- 1173,1179 ---- # endif p_extra = NULL; c_extra = ' '; + c_final = NUL; n_extra = get_breakindent_win(wp, ml_get_buf(wp->w_buffer, lnum, FALSE)); // Correct end of highlighted area for 'breakindent', *************** *** 1647,1655 **** #ifdef FEAT_LINEBREAK int c0; #endif - if (p_extra_free != NULL) - VIM_CLEAR(p_extra_free); // Get a character from the line itself. c = *ptr; #ifdef FEAT_LINEBREAK --- 1648,1655 ---- #ifdef FEAT_LINEBREAK int c0; #endif + VIM_CLEAR(p_extra_free); // Get a character from the line itself. c = *ptr; #ifdef FEAT_LINEBREAK *** ../vim-8.1.2244/src/testdir/test_breakindent.vim 2019-09-07 19:05:02.337280945 +0200 --- src/testdir/test_breakindent.vim 2019-11-03 15:39:00.896371959 +0100 *************** *** 614,616 **** --- 614,657 ---- call s:compare_lines(expect, lines) call s:close_windows('set vts&') endfunc + + func Test_breakindent17_vartabs() + if !has("vartabs") + return + endif + let s:input = "" + call s:test_windows('setl breakindent list listchars=tab:<-> showbreak=+++') + call setline(1, "\t" . repeat('a', 63)) + vert resize 30 + norm! 1gg$ + redraw! + let lines = s:screen_lines(1, 30) + let expect = [ + \ "<-->aaaaaaaaaaaaaaaaaaaaaaaaaa", + \ " +++aaaaaaaaaaaaaaaaaaaaaaa", + \ " +++aaaaaaaaaaaaaa ", + \ ] + call s:compare_lines(expect, lines) + call s:close_windows('set breakindent& list& listchars& showbreak&') + endfunc + + func Test_breakindent18_vartabs() + if !has("vartabs") + return + endif + let s:input = "" + call s:test_windows('setl breakindent list listchars=tab:<->') + call setline(1, "\t" . repeat('a', 63)) + vert resize 30 + norm! 1gg$ + redraw! + let lines = s:screen_lines(1, 30) + let expect = [ + \ "<-->aaaaaaaaaaaaaaaaaaaaaaaaaa", + \ " aaaaaaaaaaaaaaaaaaaaaaaaaa", + \ " aaaaaaaaaaa ", + \ ] + call s:compare_lines(expect, lines) + call s:close_windows('set breakindent& list& listchars&') + endfunc + *** ../vim-8.1.2244/src/version.c 2019-11-02 23:22:43.305161451 +0100 --- src/version.c 2019-11-03 14:37:19.611295911 +0100 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 2245, /**/ -- How To Keep A Healthy Level Of Insanity: 4. Put your garbage can on your desk and label it "in". /// 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 ///