aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-02 06:57:49 +0800
committerGitHub <noreply@github.com>2022-08-02 06:57:49 +0800
commit9c91d5c61382639c06ca59e6cc2bfda6ba6abf18 (patch)
tree3adccf6e926d21361994e7e3b86a691bda70d0a5 /src/nvim/ops.c
parentd4b9f8186d4a73a661a407efb63fe8abca2c4e88 (diff)
parent50672e3850ddd0ddacfcdcd536922440fb719093 (diff)
downloadrneovim-9c91d5c61382639c06ca59e6cc2bfda6ba6abf18.tar.gz
rneovim-9c91d5c61382639c06ca59e6cc2bfda6ba6abf18.tar.bz2
rneovim-9c91d5c61382639c06ca59e6cc2bfda6ba6abf18.zip
Merge pull request #19617 from zeertzjq/vim-8.2.4956
vim-patch:8.2.{4899,4956,5013}
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index cc67b0d0c1..0bcc5ecd0e 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -4349,6 +4349,9 @@ static void op_format(oparg_T *oap, int keep_cursor)
if (keep_cursor) {
curwin->w_cursor = saved_cursor;
saved_cursor.lnum = 0;
+
+ // formatting may have made the cursor position invalid
+ check_cursor();
}
if (oap->is_VIsual) {