To: vim_dev@googlegroups.com Subject: Patch 8.2.2177 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2177 Problem: Pattern "^" does not match if the first character in the line is combining. (Rene Kita) Solution: Do accept a match at the start of the line. (closes #6963) Files: src/regexp_nfa.c, src/testdir/test_regexp_utf8.vim *** ../vim-8.2.2176/src/regexp_nfa.c 2020-12-20 17:59:49.314315870 +0100 --- src/regexp_nfa.c 2020-12-21 14:49:39.245347750 +0100 *************** *** 5754,5762 **** { case NFA_MATCH: { ! // If the match ends before a composing characters and ! // rex.reg_icombine is not set, that is not really a match. ! if (enc_utf8 && !rex.reg_icombine && utf_iscomposing(curc)) break; nfa_match = TRUE; --- 5754,5764 ---- { case NFA_MATCH: { ! // If the match is not at the start of the line, ends before a ! // composing characters and rex.reg_icombine is not set, that ! // is not really a match. ! if (enc_utf8 && !rex.reg_icombine ! && rex.input != rex.line && utf_iscomposing(curc)) break; nfa_match = TRUE; *** ../vim-8.2.2176/src/testdir/test_regexp_utf8.vim 2020-10-02 18:48:02.846263669 +0200 --- src/testdir/test_regexp_utf8.vim 2020-12-21 14:49:00.053522123 +0100 *************** *** 501,504 **** --- 501,515 ---- close! endfunc + " Check that "^" matches even when the line starts with a combining char + func Test_match_start_of_line_combining() + new + call setline(1, ['', "\u05ae", '']) + exe "normal gg/^\" + call assert_equal(2, getcurpos()[1]) + bwipe! + endfunc + + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.2176/src/version.c 2020-12-21 14:01:38.328550550 +0100 --- src/version.c 2020-12-21 14:44:24.706824913 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2177, /**/ -- Every engineer dreams about saving the universe and having sex with aliens. This is much more glamorous than the real life of an engineer, which consists of hiding from the universe and having sex without the participation of other life forms. (Scott Adams - The Dilbert principle) /// 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 ///