Patch 8.2.3610
Problem:    Crash when ModeChanged triggered too early.
Solution:   Trigger ModeChanged after setting VIsual.
Files:      src/normal.c, src/testdir/test_edit.vim


*** ../vim-8.2.3609/src/normal.c        2021-11-12 10:29:42.178810539 +0000
--- src/normal.c        2021-11-17 16:51:53.554737557 +0000
***************
*** 5778,5784 ****
      VIsual_mode = c;
      VIsual_active = TRUE;
      VIsual_reselect = TRUE;
-     trigger_modechanged();
  
      // Corner case: the 0 position in a tab may change when going into
      // virtualedit.  Recalculate curwin->w_cursor to avoid bad highlighting.
--- 5778,5783 ----
***************
*** 5793,5798 ****
--- 5792,5798 ----
      foldAdjustVisual();
  #endif
  
+     trigger_modechanged();
      setmouse();
  #ifdef FEAT_CONCEAL
      // Check if redraw is needed after changing the state.
*** ../vim-8.2.3609/src/testdir/test_edit.vim   2021-11-17 15:51:46.421992164 
+0000
--- src/testdir/test_edit.vim   2021-11-17 16:51:26.342778284 +0000
***************
*** 2037,2043 ****
  func Test_recursive_ModeChanged()
    au! ModeChanged * norm 0u
    sil! norm  
!   au!
  endfunc
  
  " Test toggling of input method. See :help i_CTRL-^
--- 2037,2051 ----
  func Test_recursive_ModeChanged()
    au! ModeChanged * norm 0u
    sil! norm  
!   au! ModeChanged
! endfunc
! 
! func Test_ModeChanged_starts_visual()
!   " This was triggering ModeChanged before setting VIsual, causing a crash.
!   au! ModeChanged * norm 0u
!   sil! norm  
! 
!   au! ModeChanged
  endfunc
  
  " Test toggling of input method. See :help i_CTRL-^
*** ../vim-8.2.3609/src/version.c       2021-11-17 15:51:46.421992164 +0000
--- src/version.c       2021-11-17 16:46:45.095188414 +0000
***************
*** 759,760 ****
--- 759,762 ----
  {   /* Add new patch number below this line */
+ /**/
+     3610,
  /**/

-- 
FATHER:    You killed eight wedding guests in all!
LAUNCELOT: Er, Well ... the thing is ... I thought your son was a lady.
FATHER:    I can understand that.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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/20211117165450.B02351C656A%40moolenaar.net.

Raspunde prin e-mail lui