diff options
author | chentau <tchen1998@gmail.com> | 2021-05-05 12:23:14 -0700 |
---|---|---|
committer | chentau <tchen1998@gmail.com> | 2021-05-06 20:40:26 -0700 |
commit | 37c8067226779f1b98a41454949c986f740f4e0e (patch) | |
tree | d715518822161444cc84b05bedfc16c8dce9c0fa /src | |
parent | b227cedf82341813514da55baa48511eca4014b0 (diff) | |
download | rneovim-37c8067226779f1b98a41454949c986f740f4e0e.tar.gz rneovim-37c8067226779f1b98a41454949c986f740f4e0e.tar.bz2 rneovim-37c8067226779f1b98a41454949c986f740f4e0e.zip |
splice extmarks on every line for block visual paste
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ops.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 190ca2e93b..18167bcdd9 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -3334,6 +3334,9 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags) changed_cline_bef_curs(); curwin->w_cursor.col += (colnr_T)(totlen - 1); } + changed_bytes(lnum, col); + extmark_splice_cols(curbuf, (int)lnum-1, col, + 0, (int)totlen, kExtmarkUndo); } if (VIsual_active) { lnum++; @@ -3345,12 +3348,10 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags) } curbuf->b_op_end = curwin->w_cursor; - /* For "CTRL-O p" in Insert mode, put cursor after last char */ - if (totlen && (restart_edit != 0 || (flags & PUT_CURSEND))) - ++curwin->w_cursor.col; - changed_bytes(lnum, col); - extmark_splice_cols(curbuf, (int)lnum-1, col, - 0, (int)totlen, kExtmarkUndo); + // For "CTRL-O p" in Insert mode, put cursor after last char + if (totlen && (restart_edit != 0 || (flags & PUT_CURSEND))) { + curwin->w_cursor.col++; + } } else { // Insert at least one line. When y_type is kMTCharWise, break the first // line in two. |