To: vim_dev@googlegroups.com Subject: Patch 9.0.0175 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0175 Problem: Spell checking for capital not working with trailing space. Solution: Do not calculate cap_col at the end of the line. (Christian Brabandt, closes #10870, issue #10838) Files: src/drawline.c, src/testdir/test_spell.vim, src/testdir/dumps/Test_spell_2.dump *** ../vim-9.0.0174/src/drawline.c 2022-08-08 16:03:02.310984016 +0100 --- src/drawline.c 2022-08-09 12:23:25.048367578 +0100 *************** *** 2279,2285 **** if (has_spell && v >= word_end && v > cur_checked_col) { spell_attr = 0; ! if (c != 0 && ( # ifdef FEAT_SYN_HL !has_syntax || # endif --- 2279,2287 ---- if (has_spell && v >= word_end && v > cur_checked_col) { spell_attr = 0; ! // do not calculate cap_col at the end of the line or when ! // only white space is following ! if (c != 0 && (*skipwhite(prev_ptr) != NUL) && ( # ifdef FEAT_SYN_HL !has_syntax || # endif *** ../vim-9.0.0174/src/testdir/test_spell.vim 2022-07-14 17:25:08.637262152 +0100 --- src/testdir/test_spell.vim 2022-08-09 12:19:10.675574903 +0100 *************** *** 965,970 **** --- 965,993 ---- call delete('XtestSpell') endfunc + func Test_spell_screendump_spellcap() + CheckScreendump + + let lines =<< trim END + call setline(1, [ + \ " This line has a sepll error. and missing caps and trailing spaces. ", + \ "another missing cap here.", + \ "", + \ "and here.", + \ " ", + \ "and here." + \ ]) + set spell spelllang=en + END + call writefile(lines, 'XtestSpellCap') + let buf = RunVimInTerminal('-S XtestSpellCap', {'rows': 8}) + call VerifyScreenDump(buf, 'Test_spell_2', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('XtestSpellCap') + endfunc + let g:test_data_aff1 = [ \"SET ISO8859-1", \"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ", *** ../vim-9.0.0174/src/testdir/dumps/Test_spell_2.dump 2022-08-09 12:24:05.988450947 +0100 --- src/testdir/dumps/Test_spell_2.dump 2022-08-09 12:19:10.675574903 +0100 *************** *** 0 **** --- 1,8 ---- + > +0&#ffffff0@2|T|h|i|s| |l|i|n|e| |h|a|s| |a| |s+0&#ffd7d7255|e|p|l@1| +0&#ffffff0|e|r@1|o|r|.| |a+0fd7ff255|n|d| +0&#ffffff0|m|i|s@1|i|n|g| |c|a|p|s| |a|n|d| |t|r|a|i|l|i|n|g| |s|p|a|c|e|s|.| @5 + |a+0fd7ff255|n|o|t|h|e|r| +0&#ffffff0|m|i|s@1|i|n|g| |c|a|p| |h|e|r|e|.| @49 + @75 + |a+0fd7ff255|n|d| +0&#ffffff0|h|e|r|e|.| @65 + @75 + |a+0fd7ff255|n|d| +0&#ffffff0|h|e|r|e|.| @65 + |~+0#4040ff13&| @73 + | +0#0000000&@56|1|,|1| @10|A|l@1| *** ../vim-9.0.0174/src/version.c 2022-08-08 21:43:06.990412767 +0100 --- src/version.c 2022-08-09 12:21:41.132106390 +0100 *************** *** 737,738 **** --- 737,740 ---- { /* Add new patch number below this line */ + /**/ + 175, /**/ -- A cow comes flying over the battlements, lowing aggressively. The cow lands on GALAHAD'S PAGE, squashing him completely. "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/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///