diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-08-23 20:37:26 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-09-17 02:10:45 +0100 |
commit | d78f06852e78daa4955545576ce5dfad208e4a7b (patch) | |
tree | 023993351cecfd95ed71ded147e3e83e00e8a72d /src/nvim/ops.c | |
parent | ebd035f08b667626eb5f2e02d03628483166abed (diff) | |
download | rneovim-d78f06852e78daa4955545576ce5dfad208e4a7b.tar.gz rneovim-d78f06852e78daa4955545576ce5dfad208e4a7b.tar.bz2 rneovim-d78f06852e78daa4955545576ce5dfad208e4a7b.zip |
vim-patch:8.2.3369: auto formatting after "cw" leaves cursor in wrong spot
Problem: Auto formatting after "cw" leaves cursor in wrong spot.
Solution: Do not auto-format after the delete. (closes vim/vim#8789)
https://github.com/vim/vim/commit/6b36d2a16d7931bac82ef8b5654c68ac456b24bf
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r-- | src/nvim/ops.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index a0dee7ace8..7dd06423cb 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -1725,7 +1725,9 @@ int op_delete(oparg_T *oap) (int)oap->line_count-1, n, deleted_bytes, 0, 0, 0, kExtmarkUndo); } - auto_format(false, true); + if (oap->op_type == OP_DELETE) { + auto_format(false, true); + } } msgmore(curbuf->b_ml.ml_line_count - old_lcount); @@ -2486,6 +2488,7 @@ int op_change(oparg_T *oap) xfree(ins_text); } } + auto_format(false, true); return retval; } |