To: vim_dev@googlegroups.com Subject: Patch 8.2.0146 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0146 Problem: Wrong indent when 'showbreak' and 'breakindent' are set and 'briopt' includes "sbr". Solution: Reset "need_showbreak" where needed. (Ken Takata, closes #5523) Files: src/drawline.c, src/testdir/test_breakindent.vim *** ../vim-8.2.0145/src/drawline.c 2019-12-04 19:02:58.000000000 +0100 --- src/drawline.c 2020-01-23 19:53:35.526831855 +0100 *************** *** 1176,1181 **** --- 1176,1183 ---- c_final = NUL; n_extra = get_breakindent_win(wp, ml_get_buf(wp->w_buffer, lnum, FALSE)); + if (wp->w_skipcol > 0 && wp->w_p_wrap) + need_showbreak = FALSE; // Correct end of highlighted area for 'breakindent', // required when 'linebreak' is also set. if (tocol == vcol) *************** *** 1222,1228 **** c_extra = NUL; c_final = NUL; n_extra = (int)STRLEN(sbr); ! need_showbreak = FALSE; vcol_sbr = vcol + MB_CHARLEN(sbr); // Correct end of highlighted area for 'showbreak', // required when 'linebreak' is also set. --- 1224,1231 ---- c_extra = NUL; c_final = NUL; n_extra = (int)STRLEN(sbr); ! if (wp->w_skipcol == 0 || !wp->w_p_wrap) ! need_showbreak = FALSE; vcol_sbr = vcol + MB_CHARLEN(sbr); // Correct end of highlighted area for 'showbreak', // required when 'linebreak' is also set. *** ../vim-8.2.0145/src/testdir/test_breakindent.vim 2019-11-09 23:16:46.000000000 +0100 --- src/testdir/test_breakindent.vim 2020-01-23 19:53:35.530831842 +0100 *************** *** 658,660 **** --- 658,686 ---- call s:close_windows('set breakindent& list& listchars&') endfunc + func Test_breakindent19_sbr_nextpage() + let s:input = "" + call s:test_windows('setl breakindent briopt=shift:2,sbr,min:18 sbr=>') + call setline(1, repeat('a', 200)) + norm! 1gg + redraw! + let lines = s:screen_lines(1, 20) + let expect = [ + \ "aaaaaaaaaaaaaaaaaaaa", + \ "> aaaaaaaaaaaaaaaaaa", + \ "> aaaaaaaaaaaaaaaaaa", + \ ] + call s:compare_lines(expect, lines) + " Scroll down one screen line + setl scrolloff=5 + norm! 5gj + redraw! + let lines = s:screen_lines(1, 20) + let expect = [ + \ "> aaaaaaaaaaaaaaaaaa", + \ "> aaaaaaaaaaaaaaaaaa", + \ "> aaaaaaaaaaaaaaaaaa", + \ ] + call s:compare_lines(expect, lines) + call s:close_windows('set breakindent& briopt& sbr&') + endfunc *** ../vim-8.2.0145/src/version.c 2020-01-23 16:51:58.566062088 +0100 --- src/version.c 2020-01-23 19:56:41.066156310 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 146, /**/ -- Never under any circumstances take a sleeping pill and a laxative on the same night. /// 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 ///