comparison src/normal.c @ 12467:66fe20238c1d v8.0.1113

patch 8.0.1113: can go to Insert mode from Terminal-Normal mode commit https://github.com/vim/vim/commit/eef9adddab4c7fc7bb1c54267e76849caf565edf Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 16 15:38:04 2017 +0200 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)
author Christian Brabandt <cb@256bit.org>
date Sat, 16 Sep 2017 15:45:03 +0200
parents 8e4ea67eca0b
children 68d7bc045dbe
comparison
equal deleted inserted replaced
12466:2f5d2f70f891 12467:66fe20238c1d
1307 do_check_cursorbind(); 1307 do_check_cursorbind();
1308 } 1308 }
1309 #endif 1309 #endif
1310 1310
1311 #ifdef FEAT_TERMINAL 1311 #ifdef FEAT_TERMINAL
1312 /* don't go to Insert mode from Terminal-Job mode */ 1312 /* don't go to Insert mode if a terminal has a running job */
1313 if (term_use_loop()) 1313 if (term_job_running(curbuf->b_term))
1314 restart_edit = 0; 1314 restart_edit = 0;
1315 #endif 1315 #endif
1316 1316
1317 /* 1317 /*
1318 * May restart edit(), if we got here with CTRL-O in Insert mode (but not 1318 * May restart edit(), if we got here with CTRL-O in Insert mode (but not
9042 if (cap->cmdchar == K_INS || cap->cmdchar == K_KINS) 9042 if (cap->cmdchar == K_INS || cap->cmdchar == K_KINS)
9043 cap->cmdchar = 'i'; 9043 cap->cmdchar = 'i';
9044 9044
9045 /* in Visual mode "A" and "I" are an operator */ 9045 /* in Visual mode "A" and "I" are an operator */
9046 if (VIsual_active && (cap->cmdchar == 'A' || cap->cmdchar == 'I')) 9046 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
9047 v_visop(cap); 9057 v_visop(cap);
9058 }
9048 9059
9049 /* in Visual mode and after an operator "a" and "i" are for text objects */ 9060 /* in Visual mode and after an operator "a" and "i" are for text objects */
9050 else if ((cap->cmdchar == 'a' || cap->cmdchar == 'i') 9061 else if ((cap->cmdchar == 'a' || cap->cmdchar == 'i')
9051 && (cap->oap->op_type != OP_NOP || VIsual_active)) 9062 && (cap->oap->op_type != OP_NOP || VIsual_active))
9052 { 9063 {