From fedb8443d58af82f7603164395ff253b94c913ae Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 19 Feb 2017 03:48:20 +0100 Subject: terminal: Allow undo and 'modifiable'. Partial step towards #2637. Will crash if *all* lines are deleted. Closes #2607 References #5431 --- src/nvim/normal.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/nvim/normal.c') diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 756053dc73..e79939ab10 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -7435,12 +7435,10 @@ static void nv_edit(cmdarg_T *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 - )) { + && (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)) { -- cgit From e7bbd35c812d338918d1c23692c70b403205fb30 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 21 Feb 2017 15:16:48 +0100 Subject: terminal: 'scrollback' Closes #2637 --- src/nvim/normal.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/nvim/normal.c') diff --git a/src/nvim/normal.c b/src/nvim/normal.c index e79939ab10..a51de5fe3c 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -7420,22 +7420,20 @@ static void nv_esc(cmdarg_T *cap) restart_edit = 'a'; } -/* - * Handle "A", "a", "I", "i" and commands. - */ +/// Handle "A", "a", "I", "i" and commands. static void nv_edit(cmdarg_T *cap) { - /* is equal to "i" */ - if (cap->cmdchar == K_INS || cap->cmdchar == K_KINS) + // 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 && !curbuf->terminal) { // Only give this error when 'insertmode' is off. -- cgit