To: vim_dev@googlegroups.com Subject: Patch 9.0.0608 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0608 Problem: With spell checking, deleting a full stop at the end of a line does not update SpellCap at the start of the next line. Solution: Update the next line when characters have been deleted. Also when using undo. Files: src/edit.c, src/change.c, src/undo.c, src/testdir/test_spell.vim, src/testdir/dumps/Test_spell_4.dump, src/testdir/dumps/Test_spell_5.dump *** ../vim-9.0.0607/src/edit.c 2022-09-27 12:30:53.222180148 +0100 --- src/edit.c 2022-09-27 16:06:10.617797815 +0100 *************** *** 3607,3619 **** #ifdef FEAT_SPELL check_spell_redraw(); - - // When text has been changed in this line, possibly the start of the next - // line may have SpellCap that should be removed or it needs to be - // displayed. Schedule the next line for redrawing just in case. - if (spell_check_window(curwin) - && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) - redrawWinline(curwin, curwin->w_cursor.lnum + 1); #endif temp = curwin->w_cursor.col; --- 3607,3612 ---- *** ../vim-9.0.0607/src/change.c 2022-09-14 22:13:06.069843985 +0100 --- src/change.c 2022-09-27 16:01:51.843216229 +0100 *************** *** 709,714 **** --- 709,721 ---- changedOneline(curbuf, lnum); changed_common(lnum, col, lnum + 1, 0L); + #ifdef FEAT_SPELL + // When text has been changed at the end of the line, possibly the start of + // the next line may have SpellCap that should be removed or it needs to be + // displayed. Schedule the next line for redrawing just in case. + if (spell_check_window(curwin) && lnum < curbuf->b_ml.ml_line_count) + redrawWinline(curwin, lnum + 1); + #endif #ifdef FEAT_DIFF // Diff highlighting in other diff windows may need to be updated too. if (curwin->w_p_diff) *** ../vim-9.0.0607/src/undo.c 2022-08-14 14:16:08.003582142 +0100 --- src/undo.c 2022-09-27 16:15:29.599237760 +0100 *************** *** 2835,2841 **** --- 2835,2850 ---- curbuf->b_op_end.lnum += newsize - oldsize; } if (oldsize > 0 || newsize > 0) + { changed_lines(top + 1, 0, bot, newsize - oldsize); + #ifdef FEAT_SPELL + // When text has been changed, possibly the start of the next line + // may have SpellCap that should be removed or it needs to be + // displayed. Schedule the next line for redrawing just in case. + if (spell_check_window(curwin) && bot <= curbuf->b_ml.ml_line_count) + redrawWinline(curwin, bot); + #endif + } // Set the '[ mark. if (top + 1 < curbuf->b_op_start.lnum) *** ../vim-9.0.0607/src/testdir/test_spell.vim 2022-09-25 20:58:08.801019377 +0100 --- src/testdir/test_spell.vim 2022-09-27 16:26:36.480548190 +0100 *************** *** 987,992 **** --- 987,1000 ---- call term_sendkeys(buf, "3GANot\") call VerifyScreenDump(buf, 'Test_spell_3', {}) + " Deleting a full stop removes missing Cap in next line + call term_sendkeys(buf, "5Gddk$x") + call VerifyScreenDump(buf, 'Test_spell_4', {}) + + " Undo also updates the next line (go to command line to remove message) + call term_sendkeys(buf, "u:\") + call VerifyScreenDump(buf, 'Test_spell_5', {}) + " clean up call StopVimInTerminal(buf) call delete('XtestSpellCap') *** ../vim-9.0.0607/src/testdir/dumps/Test_spell_4.dump 2022-09-27 16:27:40.260299402 +0100 --- src/testdir/dumps/Test_spell_4.dump 2022-09-27 16:24:24.837064787 +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 + |N|o|t| @71 + |a|n|d| |h|e|r>e| @66 + |a|n|d| |h|e|r|e|.| @65 + |~+0#4040ff13&| @73 + |~| @73 + | +0#0000000&@56|4|,|8| @10|A|l@1| *** ../vim-9.0.0607/src/testdir/dumps/Test_spell_5.dump 2022-09-27 16:27:40.260299402 +0100 --- src/testdir/dumps/Test_spell_5.dump 2022-09-27 16:24:24.837064787 +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 + |N|o|t| @71 + |a|n|d| |h|e|r|e>.| @65 + |a+0fd7ff255|n|d| +0&#ffffff0|h|e|r|e|.| @65 + |~+0#4040ff13&| @73 + |~| @73 + | +0#0000000&@56|4|,|9| @10|A|l@1| *** ../vim-9.0.0607/src/version.c 2022-09-27 15:55:39.944808497 +0100 --- src/version.c 2022-09-27 16:03:53.390522410 +0100 *************** *** 701,702 **** --- 701,704 ---- { /* Add new patch number below this line */ + /**/ + 608, /**/ -- Some of the well known MS-Windows errors: EHUH Unexpected error EUSER User error, not our fault! EGOD Horrible problem, god knows what has happened EERR Errornous error: nothing wrong /// 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 ///