patch 8.2.3610: crash when ModeChanged triggered too early
Problem: Crash when ModeChanged triggered too early.
Solution: Trigger ModeChanged after setting VIsual.
diff --git a/src/normal.c b/src/normal.c
index 11b61f9..059baee 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -5778,7 +5778,6 @@
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.
@@ -5793,6 +5792,7 @@
foldAdjustVisual();
#endif
+ trigger_modechanged();
setmouse();
#ifdef FEAT_CONCEAL
// Check if redraw is needed after changing the state.