Mercurial > vim
comparison src/normal.c @ 26042:6b39ab99e367 v8.2.3555
patch 8.2.3555: ModeChanged is not triggered on every mode change
Commit: https://github.com/vim/vim/commit/25def2c8b8bd7b0c3d5f020207c717a880b05d50
Author: =?UTF-8?q?Magnus=20Gro=C3=9F?= <magnus.gross@rwth-aachen.de>
Date: Fri Oct 22 18:56:39 2021 +0100
patch 8.2.3555: ModeChanged is not triggered on every mode change
Problem: ModeChanged is not triggered on every mode change.
Solution: Also trigger on minor mode changes. (Maguns Gross, closes https://github.com/vim/vim/issues/8999)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 22 Oct 2021 20:00:05 +0200 |
parents | e8873138ffbb |
children | f53f365078dd |
comparison
equal
deleted
inserted
replaced
26041:1f1f9e2a021b | 26042:6b39ab99e367 |
---|---|
525 # ifdef FEAT_MOUSESHAPE | 525 # ifdef FEAT_MOUSESHAPE |
526 update_mouseshape(-1); | 526 update_mouseshape(-1); |
527 # endif | 527 # endif |
528 } | 528 } |
529 #endif | 529 #endif |
530 trigger_modechanged(); | |
530 | 531 |
531 // When not finishing an operator and no register name typed, reset the | 532 // When not finishing an operator and no register name typed, reset the |
532 // count. | 533 // count. |
533 if (!finish_op && !oap->regname) | 534 if (!finish_op && !oap->regname) |
534 { | 535 { |
1219 // Reset finish_op, in case it was set | 1220 // Reset finish_op, in case it was set |
1220 #ifdef CURSOR_SHAPE | 1221 #ifdef CURSOR_SHAPE |
1221 c = finish_op; | 1222 c = finish_op; |
1222 #endif | 1223 #endif |
1223 finish_op = FALSE; | 1224 finish_op = FALSE; |
1225 trigger_modechanged(); | |
1224 #ifdef CURSOR_SHAPE | 1226 #ifdef CURSOR_SHAPE |
1225 // Redraw the cursor with another shape, if we were in Operator-pending | 1227 // Redraw the cursor with another shape, if we were in Operator-pending |
1226 // mode or did a replace command. | 1228 // mode or did a replace command. |
1227 if (c || ca.cmdchar == 'r') | 1229 if (c || ca.cmdchar == 'r') |
1228 { | 1230 { |
1276 && oap->regname == 0) | 1278 && oap->regname == 0) |
1277 { | 1279 { |
1278 if (restart_VIsual_select == 1) | 1280 if (restart_VIsual_select == 1) |
1279 { | 1281 { |
1280 VIsual_select = TRUE; | 1282 VIsual_select = TRUE; |
1283 trigger_modechanged(); | |
1281 showmode(); | 1284 showmode(); |
1282 restart_VIsual_select = 0; | 1285 restart_VIsual_select = 0; |
1283 } | 1286 } |
1284 if (restart_edit != 0 && !VIsual_active && old_mapped_len == 0) | 1287 if (restart_edit != 0 && !VIsual_active && old_mapped_len == 0) |
1285 (void)edit(restart_edit, FALSE, 1L); | 1288 (void)edit(restart_edit, FALSE, 1L); |
1384 } | 1387 } |
1385 # endif | 1388 # endif |
1386 #endif | 1389 #endif |
1387 | 1390 |
1388 VIsual_active = FALSE; | 1391 VIsual_active = FALSE; |
1389 trigger_modechanged(); | |
1390 setmouse(); | 1392 setmouse(); |
1391 mouse_dragging = 0; | 1393 mouse_dragging = 0; |
1392 | 1394 |
1393 // Save the current VIsual area for '< and '> marks, and "gv" | 1395 // Save the current VIsual area for '< and '> marks, and "gv" |
1394 curbuf->b_visual.vi_mode = VIsual_mode; | 1396 curbuf->b_visual.vi_mode = VIsual_mode; |
1401 if (!virtual_active()) | 1403 if (!virtual_active()) |
1402 curwin->w_cursor.coladd = 0; | 1404 curwin->w_cursor.coladd = 0; |
1403 may_clear_cmdline(); | 1405 may_clear_cmdline(); |
1404 | 1406 |
1405 adjust_cursor_eol(); | 1407 adjust_cursor_eol(); |
1408 trigger_modechanged(); | |
1406 } | 1409 } |
1407 | 1410 |
1408 /* | 1411 /* |
1409 * Reset VIsual_active and VIsual_reselect. | 1412 * Reset VIsual_active and VIsual_reselect. |
1410 */ | 1413 */ |
3437 nv_ctrlg(cmdarg_T *cap) | 3440 nv_ctrlg(cmdarg_T *cap) |
3438 { | 3441 { |
3439 if (VIsual_active) // toggle Selection/Visual mode | 3442 if (VIsual_active) // toggle Selection/Visual mode |
3440 { | 3443 { |
3441 VIsual_select = !VIsual_select; | 3444 VIsual_select = !VIsual_select; |
3445 trigger_modechanged(); | |
3442 showmode(); | 3446 showmode(); |
3443 } | 3447 } |
3444 else if (!checkclearop(cap->oap)) | 3448 else if (!checkclearop(cap->oap)) |
3445 // print full name if count given or :cd used | 3449 // print full name if count given or :cd used |
3446 fileinfo((int)cap->count0, FALSE, TRUE); | 3450 fileinfo((int)cap->count0, FALSE, TRUE); |
3499 nv_ctrlo(cmdarg_T *cap) | 3503 nv_ctrlo(cmdarg_T *cap) |
3500 { | 3504 { |
3501 if (VIsual_active && VIsual_select) | 3505 if (VIsual_active && VIsual_select) |
3502 { | 3506 { |
3503 VIsual_select = FALSE; | 3507 VIsual_select = FALSE; |
3508 trigger_modechanged(); | |
3504 showmode(); | 3509 showmode(); |
3505 restart_VIsual_select = 2; // restart Select mode later | 3510 restart_VIsual_select = 2; // restart Select mode later |
3506 } | 3511 } |
3507 else | 3512 else |
3508 { | 3513 { |