Patch 9.0.0664
Problem:    Bad redrawing with spell checking, using "C" and "$" in 'cpo'.
Solution:   Do not redraw the next line when "$" is in 'cpo'. (closes #11285)
Files:      src/change.c, src/edit.c, src/testdir/test_spell.vim,
            src/testdir/dumps/Test_spell_compatible_1.dump,
            src/testdir/dumps/Test_spell_compatible_2.dump


*** ../vim-9.0.0663/src/change.c        2022-09-27 16:27:56.100237745 +0100
--- src/change.c        2022-10-05 13:25:05.409706078 +0100
***************
*** 713,719 ****
      // 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
--- 713,722 ----
      // 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.
!     // Don't do this when displaying '$' at the end of changed text.
!     if (spell_check_window(curwin)
!           && lnum < curbuf->b_ml.ml_line_count
!           && vim_strchr(p_cpo, CPO_DOLLAR) == NULL)
        redrawWinline(curwin, lnum + 1);
  #endif
  #ifdef FEAT_DIFF
*** ../vim-9.0.0663/src/edit.c  2022-10-04 16:23:39.010042185 +0100
--- src/edit.c  2022-10-05 13:26:50.037457451 +0100
***************
*** 1738,1745 ****
  }
  
  /*
!  * Called when p_dollar is set: display a '$' at the end of the changed text
!  * Only works when cursor is in the line that changes.
   */
      void
  display_dollar(colnr_T col_arg)
--- 1738,1745 ----
  }
  
  /*
!  * Called when "$" is in 'cpoptions': display a '$' at the end of the changed
!  * text.  Only works when cursor is in the line that changes.
   */
      void
  display_dollar(colnr_T col_arg)
*** ../vim-9.0.0663/src/testdir/test_spell.vim  2022-09-28 14:08:17.925866871 
+0100
--- src/testdir/test_spell.vim  2022-10-05 13:19:52.994470010 +0100
***************
*** 956,968 ****
               \ ])
         set spell spelllang=en_nz
    END
!   call writefile(lines, 'XtestSpell')
    let buf = RunVimInTerminal('-S XtestSpell', {'rows': 8})
    call VerifyScreenDump(buf, 'Test_spell_1', {})
  
    " clean up
    call StopVimInTerminal(buf)
-   call delete('XtestSpell')
  endfunc
  
  func Test_spell_screendump_spellcap()
--- 956,967 ----
               \ ])
         set spell spelllang=en_nz
    END
!   call writefile(lines, 'XtestSpell', 'D')
    let buf = RunVimInTerminal('-S XtestSpell', {'rows': 8})
    call VerifyScreenDump(buf, 'Test_spell_1', {})
  
    " clean up
    call StopVimInTerminal(buf)
  endfunc
  
  func Test_spell_screendump_spellcap()
***************
*** 979,985 ****
               \ ])
         set spell spelllang=en
    END
!   call writefile(lines, 'XtestSpellCap')
    let buf = RunVimInTerminal('-S XtestSpellCap', {'rows': 8})
    call VerifyScreenDump(buf, 'Test_spell_2', {})
  
--- 978,984 ----
               \ ])
         set spell spelllang=en
    END
!   call writefile(lines, 'XtestSpellCap', 'D')
    let buf = RunVimInTerminal('-S XtestSpellCap', {'rows': 8})
    call VerifyScreenDump(buf, 'Test_spell_2', {})
  
***************
*** 997,1003 ****
  
    " clean up
    call StopVimInTerminal(buf)
!   call delete('XtestSpellCap')
  endfunc
  
  let g:test_data_aff1 = [
--- 996,1025 ----
  
    " clean up
    call StopVimInTerminal(buf)
! endfunc
! 
! func Test_spell_compatible()
!   CheckScreendump
! 
!   let lines =<< trim END
!        call setline(1, [
!              \ "test "->repeat(20),
!              \ "",
!              \ "end",
!              \ ])
!        set spell cpo+=$
!   END
!   call writefile(lines, 'XtestSpellComp', 'D')
!   let buf = RunVimInTerminal('-S XtestSpellComp', {'rows': 8})
! 
!   call term_sendkeys(buf, "51|C")
!   call VerifyScreenDump(buf, 'Test_spell_compatible_1', {})
! 
!   call term_sendkeys(buf, "x")
!   call VerifyScreenDump(buf, 'Test_spell_compatible_2', {})
! 
!   " clean up
!   call StopVimInTerminal(buf)
  endfunc
  
  let g:test_data_aff1 = [
*** ../vim-9.0.0663/src/testdir/dumps/Test_spell_compatible_1.dump      
2022-10-05 13:28:09.177271109 +0100
--- src/testdir/dumps/Test_spell_compatible_1.dump      2022-10-05 
13:19:55.958462562 +0100
***************
*** 0 ****
--- 1,8 ----
+ |t+0&#5fd7ff255|e|s|t| +0&#ffffff0|t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| 
|t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| >t|e|s|t| |t|e|s|t| |t|e|s|t| 
|t|e|s|t| |t|e|s|t| 
+ |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t|$| @49
+ @75
+ |e+0&#5fd7ff255|n|d| +0&#ffffff0@71
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ |-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|5|1| @9|A|l@1| 
*** ../vim-9.0.0663/src/testdir/dumps/Test_spell_compatible_2.dump      
2022-10-05 13:28:09.181271100 +0100
--- src/testdir/dumps/Test_spell_compatible_2.dump      2022-10-05 
13:19:57.114459661 +0100
***************
*** 0 ****
--- 1,8 ----
+ |t+0&#5fd7ff255|e|s|t| +0&#ffffff0|t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| 
|t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |x>e|s|t| |t|e|s|t| |t|e|s|t| 
|t|e|s|t| |t|e|s|t| 
+ |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t|$| @49
+ @75
+ |e+0&#5fd7ff255|n|d| +0&#ffffff0@71
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ |-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|5|2| @9|A|l@1| 
*** ../vim-9.0.0663/src/version.c       2022-10-05 11:24:42.228494178 +0100
--- src/version.c       2022-10-05 13:12:04.771726582 +0100
***************
*** 701,702 ****
--- 701,704 ----
  {   /* Add new patch number below this line */
+ /**/
+     664,
  /**/

-- 
The software said it requires Windows 95 or better, so I installed Linux.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221005122946.24B7F1C0475%40moolenaar.net.

Raspunde prin e-mail lui