Skip to content

Commit eef9add

Browse files
committed
patch 8.0.1113: can go to Insert mode from Terminal-Normal mode
Problem: Can go to Insert mode from Terminal-Normal mode. Solution: Prevent :startinsert and "VA" to enter Insert mode. (Yasuhiro Matsumoto, closes #2092)
1 parent fc2b270 commit eef9add

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/normal.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,8 @@ normal_cmd(
13091309
#endif
13101310

13111311
#ifdef FEAT_TERMINAL
1312-
/* don't go to Insert mode from Terminal-Job mode */
1313-
if (term_use_loop())
1312+
/* don't go to Insert mode if a terminal has a running job */
1313+
if (term_job_running(curbuf->b_term))
13141314
restart_edit = 0;
13151315
#endif
13161316

@@ -9044,7 +9044,18 @@ nv_edit(cmdarg_T *cap)
90449044

90459045
/* in Visual mode "A" and "I" are an operator */
90469046
if (VIsual_active && (cap->cmdchar == 'A' || cap->cmdchar == 'I'))
9047+
{
9048+
#ifdef FEAT_TERMINAL
9049+
if (term_in_normal_mode())
9050+
{
9051+
end_visual_mode();
9052+
clearop(cap->oap);
9053+
term_enter_job_mode();
9054+
return;
9055+
}
9056+
#endif
90479057
v_visop(cap);
9058+
}
90489059

90499060
/* in Visual mode and after an operator "a" and "i" are for text objects */
90509061
else if ((cap->cmdchar == 'a' || cap->cmdchar == 'i')

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
1113,
772774
/**/
773775
1112,
774776
/**/

0 commit comments

Comments
 (0)