diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-10-16 08:01:44 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-16 08:01:44 +0800 |
| commit | bc798dfd8cea9a5f93461e05dcb8409b6d96afc0 (patch) | |
| tree | f894c80adb4ba5458eab8a5fdbb4e3c265e2f79e /src/nvim/ops.c | |
| parent | 80161ec7d6edc8f5ae1fa21de81c43f2f01751c2 (diff) | |
| download | rneovim-bc798dfd8cea9a5f93461e05dcb8409b6d96afc0.tar.gz rneovim-bc798dfd8cea9a5f93461e05dcb8409b6d96afc0.tar.bz2 rneovim-bc798dfd8cea9a5f93461e05dcb8409b6d96afc0.zip | |
vim-patch:9.0.0765: with a Visual block a put command column may go negative (#20676)
Problem: With a Visual block a put command column may go negative.
Solution: Check that the column does not become negative.
https://github.com/vim/vim/commit/36343ae0fb7247e060abfd35fb8e4337b33abb4b
Diffstat (limited to 'src/nvim/ops.c')
| -rw-r--r-- | src/nvim/ops.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 8b2fea9535..71e754537d 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -3370,6 +3370,9 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags) // adjust '] mark curbuf->b_op_end.lnum = curwin->w_cursor.lnum - 1; curbuf->b_op_end.col = bd.textcol + (colnr_T)totlen - 1; + if (curbuf->b_op_end.col < 0) { + curbuf->b_op_end.col = 0; + } curbuf->b_op_end.coladd = 0; if (flags & PUT_CURSEND) { colnr_T len; |