Problem: Crash when ModeChanged triggered too early.
Solution: Trigger ModeChanged after setting VIsual.
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.
foldAdjustVisual();
#endif
+ trigger_modechanged();
setmouse();
#ifdef FEAT_CONCEAL
// Check if redraw is needed after changing the state.
func Test_recursive_ModeChanged()
au! ModeChanged * norm 0u
sil! norm \16
- au!
+ au! ModeChanged
+endfunc
+
+func Test_ModeChanged_starts_visual()
+ " This was triggering ModeChanged before setting VIsual, causing a crash.
+ au! ModeChanged * norm 0u
+ sil! norm \16
+
+ au! ModeChanged
endfunc
" Test toggling of input method. See :help i_CTRL-^
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3610,
/**/
3609,
/**/