1
0
forked from aniani/vim

patch 8.2.5013: after text formatting cursor may be in an invalid position

Problem:    After text formatting the cursor may be in an invalid position.
Solution:   Correct the cursor position after formatting.
This commit is contained in:
Bram Moolenaar
2022-05-24 13:57:54 +01:00
parent 53737b5eee
commit 78d52883e1
3 changed files with 17 additions and 0 deletions

View File

@@ -870,6 +870,9 @@ op_format(
{
curwin->w_cursor = saved_cursor;
saved_cursor.lnum = 0;
// formatting may have made the cursor position invalid
check_cursor();
}
if (oap->is_VIsual)