To: vim_dev@googlegroups.com Subject: Patch 8.2.1058 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1058 Problem: Multiline conceal causes display errors. Solution: Do not allow conceal cross over EOL. (closes #6326, closes #4854, closes #6302) Files: src/drawline.c, src/testdir/test_conceal.vim, src/testdir/test_diffmode.vim *** ../vim-8.2.1057/src/drawline.c 2020-06-25 20:07:00.830799075 +0200 --- src/drawline.c 2020-06-25 22:19:09.998215434 +0200 *************** *** 1334,1339 **** --- 1334,1344 ---- &screen_search_hl, &has_match_conc, &match_conc, did_line_attr, lcs_eol_one); ptr = line + v; // "line" may have been changed + + // Do not allow a conceal over EOL otherwise EOL will be missed + // and bad things happen. + if (*ptr == NUL) + has_match_conc = 0; } #endif *** ../vim-8.2.1057/src/testdir/test_conceal.vim 2020-04-08 21:50:18.872619665 +0200 --- src/testdir/test_conceal.vim 2020-06-25 22:19:09.998215434 +0200 *************** *** 254,257 **** --- 254,279 ---- call delete('XTest_conceal_curpos') endfunc + func Test_conceal_eol() + new! + setlocal concealcursor=n conceallevel=1 + call setline(1, ["x", ""]) + call matchaddpos('Conceal', [[2, 1, 1]], 2, -1, {'conceal': 1}) + redraw! + + call assert_notequal(screenchar(1, 1), screenchar(2, 2)) + call assert_equal(screenattr(1, 1), screenattr(1, 2)) + call assert_equal(screenattr(1, 2), screenattr(2, 2)) + call assert_equal(screenattr(2, 1), screenattr(2, 2)) + + set list + redraw! + + call assert_equal(screenattr(1, 1), screenattr(2, 2)) + call assert_notequal(screenattr(1, 1), screenattr(1, 2)) + call assert_notequal(screenattr(1, 2), screenattr(2, 1)) + + set nolist + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.1057/src/testdir/test_diffmode.vim 2020-06-18 19:14:58.901636994 +0200 --- src/testdir/test_diffmode.vim 2020-06-25 22:19:09.998215434 +0200 *************** *** 1118,1121 **** --- 1118,1133 ---- call delete('Xtest_diff_rnu') endfunc + func Test_diff_multilineconceal() + new + diffthis + + new + call matchadd('Conceal', 'a\nb', 9, -1, {'conceal': 'Y'}) + set cole=2 cocu=n + call setline(1, ["a", "b"]) + diffthis + redraw + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.1057/src/version.c 2020-06-25 20:56:38.723128804 +0200 --- src/version.c 2020-06-25 22:23:07.757568739 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1058, /**/ -- A parent can be arrested if his child cannot hold back a burp during a church service. [real standing law in Nebraska, United States of America] /// 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 ///