Mercurial > vim
comparison src/normal.c @ 26157:20200363816c v8.2.3610
patch 8.2.3610: crash when ModeChanged triggered too early
Commit: https://github.com/vim/vim/commit/a062006b9de0b2947ab5fb376c6e67ef92a8cd69
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Nov 17 16:52:40 2021 +0000
patch 8.2.3610: crash when ModeChanged triggered too early
Problem: Crash when ModeChanged triggered too early.
Solution: Trigger ModeChanged after setting VIsual.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 17 Nov 2021 18:00:05 +0100 |
parents | 5317b0ae4893 |
children | 34606aec52b3 |
comparison
equal
deleted
inserted
replaced
26156:ebedb61a4b9b | 26157:20200363816c |
---|---|
5776 #endif | 5776 #endif |
5777 | 5777 |
5778 VIsual_mode = c; | 5778 VIsual_mode = c; |
5779 VIsual_active = TRUE; | 5779 VIsual_active = TRUE; |
5780 VIsual_reselect = TRUE; | 5780 VIsual_reselect = TRUE; |
5781 trigger_modechanged(); | |
5782 | 5781 |
5783 // Corner case: the 0 position in a tab may change when going into | 5782 // Corner case: the 0 position in a tab may change when going into |
5784 // virtualedit. Recalculate curwin->w_cursor to avoid bad highlighting. | 5783 // virtualedit. Recalculate curwin->w_cursor to avoid bad highlighting. |
5785 if (c == Ctrl_V && (get_ve_flags() & VE_BLOCK) && gchar_cursor() == TAB) | 5784 if (c == Ctrl_V && (get_ve_flags() & VE_BLOCK) && gchar_cursor() == TAB) |
5786 { | 5785 { |
5791 | 5790 |
5792 #ifdef FEAT_FOLDING | 5791 #ifdef FEAT_FOLDING |
5793 foldAdjustVisual(); | 5792 foldAdjustVisual(); |
5794 #endif | 5793 #endif |
5795 | 5794 |
5795 trigger_modechanged(); | |
5796 setmouse(); | 5796 setmouse(); |
5797 #ifdef FEAT_CONCEAL | 5797 #ifdef FEAT_CONCEAL |
5798 // Check if redraw is needed after changing the state. | 5798 // Check if redraw is needed after changing the state. |
5799 conceal_check_cursor_line(cursor_line_was_concealed); | 5799 conceal_check_cursor_line(cursor_line_was_concealed); |
5800 #endif | 5800 #endif |