diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-02-27 09:59:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-27 09:59:58 +0100 |
commit | e502cca010357773252c686ef535bb2998aeb50b (patch) | |
tree | 8533cb3229c0de3e8e99b9ce1aff5660fa91277a /src/nvim/normal.c | |
parent | 73a054d84427191f70ea59fc6dc34314b28ad07c (diff) | |
parent | c484323dc67fbca10a2f3da3d6e65efdb3c678c3 (diff) | |
download | rneovim-e502cca010357773252c686ef535bb2998aeb50b.tar.gz rneovim-e502cca010357773252c686ef535bb2998aeb50b.tar.bz2 rneovim-e502cca010357773252c686ef535bb2998aeb50b.zip |
Merge #6142 from justinmk/term-modifiable
terminal: 'modifiable'; 'scrollback'; follow output only if cursor is on last line
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 86aefda2b2..dbd8e153a8 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -7418,27 +7418,23 @@ static void nv_esc(cmdarg_T *cap) restart_edit = 'a'; } -/* - * Handle "A", "a", "I", "i" and <Insert> commands. - */ +/// Handle "A", "a", "I", "i" and <Insert> commands. static void nv_edit(cmdarg_T *cap) { - /* <Insert> is equal to "i" */ - if (cap->cmdchar == K_INS || cap->cmdchar == K_KINS) + // <Insert> is equal to "i" + if (cap->cmdchar == K_INS || cap->cmdchar == K_KINS) { cap->cmdchar = 'i'; + } - /* in Visual mode "A" and "I" are an operator */ - if (VIsual_active && (cap->cmdchar == 'A' || cap->cmdchar == 'I')) + // in Visual mode "A" and "I" are an operator + if (VIsual_active && (cap->cmdchar == 'A' || cap->cmdchar == 'I')) { 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') - && (cap->oap->op_type != OP_NOP - || VIsual_active - )) { + // in Visual mode and after an operator "a" and "i" are for text objects + } else if ((cap->cmdchar == 'a' || cap->cmdchar == 'i') + && (cap->oap->op_type != OP_NOP || VIsual_active)) { nv_object(cap); - } else if (!curbuf->b_p_ma && !p_im) { - /* Only give this error when 'insertmode' is off. */ + } else if (!curbuf->b_p_ma && !p_im && !curbuf->terminal) { + // Only give this error when 'insertmode' is off. EMSG(_(e_modifiable)); clearop(cap->oap); } else if (!checkclearopq(cap->oap)) { |