aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-10-29 09:32:03 +0800
committerGitHub <noreply@github.com>2023-10-29 09:32:03 +0800
commit82b1a389ba98f5f8e8d6c9d7485386be272a22df (patch)
tree37ed7de40ec7267b2fc9d7005b8896af5cd60484 /src
parenta5629abce29668e9781768986f7e799ba429f017 (diff)
downloadrneovim-82b1a389ba98f5f8e8d6c9d7485386be272a22df.tar.gz
rneovim-82b1a389ba98f5f8e8d6c9d7485386be272a22df.tar.bz2
rneovim-82b1a389ba98f5f8e8d6c9d7485386be272a22df.zip
fix(terminal): avoid Insert mode in Terminal buffer (#25820)
Diffstat (limited to 'src')
-rw-r--r--src/nvim/edit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index ef0317b212..1e1b67483c 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -396,6 +396,13 @@ static int insert_check(VimState *state)
Insstart_orig = Insstart;
}
+ if (curbuf->terminal) {
+ // Exit Insert mode and go to Terminal mode.
+ stop_insert_mode = true;
+ restart_edit = 'I';
+ stuffcharReadbuff(K_NOP);
+ }
+
if (stop_insert_mode && !ins_compl_active()) {
// ":stopinsert" used
s->count = 0;