0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

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)
This commit is contained in:
Bram Moolenaar
2017-09-16 15:38:04 +02:00
parent fc2b270cfd
commit eef9adddab
2 changed files with 15 additions and 2 deletions

View File

@@ -1309,8 +1309,8 @@ normal_end:
#endif #endif
#ifdef FEAT_TERMINAL #ifdef FEAT_TERMINAL
/* don't go to Insert mode from Terminal-Job mode */ /* don't go to Insert mode if a terminal has a running job */
if (term_use_loop()) if (term_job_running(curbuf->b_term))
restart_edit = 0; restart_edit = 0;
#endif #endif
@@ -9044,7 +9044,18 @@ nv_edit(cmdarg_T *cap)
/* in Visual mode "A" and "I" are an operator */ /* in Visual mode "A" and "I" are an operator */
if (VIsual_active && (cap->cmdchar == 'A' || cap->cmdchar == 'I')) 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); v_visop(cap);
}
/* in Visual mode and after an operator "a" and "i" are for text objects */ /* in Visual mode and after an operator "a" and "i" are for text objects */
else if ((cap->cmdchar == 'a' || cap->cmdchar == 'i') else if ((cap->cmdchar == 'a' || cap->cmdchar == 'i')

View File

@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1113,
/**/ /**/
1112, 1112,
/**/ /**/