mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.3610: crash when ModeChanged triggered too early
Problem: Crash when ModeChanged triggered too early. Solution: Trigger ModeChanged after setting VIsual.
This commit is contained in:
parent
3075a45592
commit
a062006b9d
@ -5778,7 +5778,6 @@ n_start_visual_mode(int c)
|
|||||||
VIsual_mode = c;
|
VIsual_mode = c;
|
||||||
VIsual_active = TRUE;
|
VIsual_active = TRUE;
|
||||||
VIsual_reselect = TRUE;
|
VIsual_reselect = TRUE;
|
||||||
trigger_modechanged();
|
|
||||||
|
|
||||||
// Corner case: the 0 position in a tab may change when going into
|
// Corner case: the 0 position in a tab may change when going into
|
||||||
// virtualedit. Recalculate curwin->w_cursor to avoid bad highlighting.
|
// virtualedit. Recalculate curwin->w_cursor to avoid bad highlighting.
|
||||||
@ -5793,6 +5792,7 @@ n_start_visual_mode(int c)
|
|||||||
foldAdjustVisual();
|
foldAdjustVisual();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
trigger_modechanged();
|
||||||
setmouse();
|
setmouse();
|
||||||
#ifdef FEAT_CONCEAL
|
#ifdef FEAT_CONCEAL
|
||||||
// Check if redraw is needed after changing the state.
|
// Check if redraw is needed after changing the state.
|
||||||
|
@ -2037,7 +2037,15 @@ endfunc
|
|||||||
func Test_recursive_ModeChanged()
|
func Test_recursive_ModeChanged()
|
||||||
au! ModeChanged * norm 0u
|
au! ModeChanged * norm 0u
|
||||||
sil! norm
|
sil! norm
|
||||||
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
|
||||||
|
|
||||||
|
au! ModeChanged
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test toggling of input method. See :help i_CTRL-^
|
" Test toggling of input method. See :help i_CTRL-^
|
||||||
|
@ -757,6 +757,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3610,
|
||||||
/**/
|
/**/
|
||||||
3609,
|
3609,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user