aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorMagnus Groß <magnus.gross@rwth-aachen.de>2021-10-22 20:36:35 +0200
committerMagnus Groß <magnus.gross@rwth-aachen.de>2021-11-18 11:23:18 +0100
commit11683193f597e1b3144ba65f08056cd44b19175f (patch)
tree1e3a890b58f32ccccf7ff075bfd212530122d3d9 /src/nvim/normal.c
parent60c154687a8b8fbdb97cf3d394ae6aa5c6f90670 (diff)
downloadrneovim-11683193f597e1b3144ba65f08056cd44b19175f.tar.gz
rneovim-11683193f597e1b3144ba65f08056cd44b19175f.tar.bz2
rneovim-11683193f597e1b3144ba65f08056cd44b19175f.zip
vim-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 vim/vim#8999) https://github.com/vim/vim/commit/25def2c8b8bd7b0c3d5f020207c717a880b05d50
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 81e8251361..686eddfb14 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -487,6 +487,7 @@ static void normal_prepare(NormalState *s)
if (finish_op != c) {
ui_cursor_shape(); // may show different cursor shape
}
+ trigger_modechanged();
// When not finishing an operator and no register name typed, reset the count.
if (!finish_op && !s->oa.regname) {
@@ -928,6 +929,7 @@ normal_end:
// Reset finish_op, in case it was set
s->c = finish_op;
finish_op = false;
+ trigger_modechanged();
// Redraw the cursor with another shape, if we were in Operator-pending
// mode or did a replace command.
if (s->c || s->ca.cmdchar == 'r') {
@@ -965,6 +967,7 @@ normal_end:
&& s->oa.regname == 0) {
if (restart_VIsual_select == 1) {
VIsual_select = true;
+ trigger_modechanged();
showmode();
restart_VIsual_select = 0;
}
@@ -3050,7 +3053,6 @@ static int get_mouse_class(char_u *p)
void end_visual_mode(void)
{
VIsual_active = false;
- trigger_modechanged();
setmouse();
mouse_dragging = 0;
@@ -3067,6 +3069,7 @@ void end_visual_mode(void)
may_clear_cmdline();
adjust_cursor_eol();
+ trigger_modechanged();
}
/*
@@ -4852,6 +4855,7 @@ static void nv_ctrlg(cmdarg_T *cap)
{
if (VIsual_active) { // toggle Selection/Visual mode
VIsual_select = !VIsual_select;
+ trigger_modechanged();
showmode();
} else if (!checkclearop(cap->oap)) {
// print full name if count given or :cd used
@@ -4895,6 +4899,7 @@ static void nv_ctrlo(cmdarg_T *cap)
{
if (VIsual_active && VIsual_select) {
VIsual_select = false;
+ trigger_modechanged();
showmode();
restart_VIsual_select = 2; // restart Select mode later
} else {