diff options
Diffstat (limited to 'src/nvim/ops.c')
| -rw-r--r-- | src/nvim/ops.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index a6eda26d75..a06db4a551 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -1121,18 +1121,13 @@ static void put_reedit_in_typebuf(int silent) } } -/* - * Insert register contents "s" into the typeahead buffer, so that it will be - * executed again. - * When "esc" is TRUE it is to be taken literally: Escape CSI characters and - * no remapping. - */ -static int put_in_typebuf( - char_u *s, - bool esc, - bool colon, // add ':' before the line - int silent -) +/// Insert register contents "s" into the typeahead buffer, so that it will be +/// executed again. +/// +/// @param esc when true then it is to be taken literally: Escape CSI +/// characters and no remapping. +/// @param colon add ':' before the line +static int put_in_typebuf(char_u *s, bool esc, bool colon, int silent) { int retval = OK; @@ -1567,8 +1562,8 @@ int op_delete(oparg_T *oap) if (oap->line_count > 1) { lnum = curwin->w_cursor.lnum; - ++curwin->w_cursor.lnum; - del_lines(oap->line_count - 1, TRUE); + curwin->w_cursor.lnum++; + del_lines(oap->line_count - 1, true); curwin->w_cursor.lnum = lnum; } if (u_save_cursor() == FAIL) @@ -1593,7 +1588,7 @@ int op_delete(oparg_T *oap) u_clearline(); // "U" command not possible after "2cc" } } else { - del_lines(oap->line_count, TRUE); + del_lines(oap->line_count, true); beginline(BL_WHITE | BL_FIX); u_clearline(); /* "U" command not possible after "dd" */ } @@ -3449,8 +3444,9 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags) (int)y_size-1, lastsize, totsize, kExtmarkUndo); } else if (y_type == kMTLineWise && flags & PUT_LINE_SPLIT) { - extmark_splice(curbuf, (int)new_cursor.lnum-1, col, 0, 0, 0, - (int)y_size+1, 0, totsize+1, kExtmarkUndo); + // Account for last pasted NL + last NL + extmark_splice(curbuf, (int)new_cursor.lnum-1, col + 1, 0, 0, 0, + (int)y_size+1, 0, totsize+2, kExtmarkUndo); } } |