summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-09-16 15:38:04 +0200
committerBram Moolenaar <Bram@vim.org>2017-09-16 15:38:04 +0200
commiteef9adddab4c7fc7bb1c54267e76849caf565edf (patch)
treea4d7a5ebcf3cd5433a94250805234c43232f4967
parentfc2b270cfd36230166df486aae4d96d9d1f32755 (diff)
patch 8.0.1113: can go to Insert mode from Terminal-Normal modev8.0.1113
Problem: Can go to Insert mode from Terminal-Normal mode. Solution: Prevent :startinsert and "VA" to enter Insert mode. (Yasuhiro Matsumoto, closes #2092)
-rw-r--r--src/normal.c15
-rw-r--r--src/version.c2
2 files changed, 15 insertions, 2 deletions
diff --git a/src/normal.c b/src/normal.c
index a1b2612f77..cbdfbc4397 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1309,8 +1309,8 @@ normal_end:
#endif
#ifdef FEAT_TERMINAL
- /* don't go to Insert mode from Terminal-Job mode */
- if (term_use_loop())
+ /* don't go to Insert mode if a terminal has a running job */
+ if (term_job_running(curbuf->b_term))
restart_edit = 0;
#endif
@@ -9044,7 +9044,18 @@ nv_edit(cmdarg_T *cap)
/* in Visual mode "A" and "I" are an operator */
if (VIsual_active && (cap->cmdchar == 'A' || cap->cmdchar == 'I'))
+ {
+#ifdef FEAT_TERMINAL
+ if (term_in_normal_mode())
+ {
+ end_visual_mode();
+ clearop(cap->oap);
+ term_enter_job_mode();
+ return;
+ }
+#endif
v_visop(cap);
+ }
/* in Visual mode and after an operator "a" and "i" are for text objects */
else if ((cap->cmdchar == 'a' || cap->cmdchar == 'i')
diff --git a/src/version.c b/src/version.c
index ce9d2c2499..6ea93a0dcb 100644
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1113,
+/**/
1112,
/**/
1111,