refactor: format casting of negative number better (#26482)

This commit is contained in:
zeertzjq
2023-12-09 11:36:11 +08:00
committed by GitHub
parent c651fb3042
commit 2ebd328a79
6 changed files with 9 additions and 9 deletions

View File

@@ -678,7 +678,7 @@ void auto_format(bool trailblank, bool prev_line)
// Do the formatting and restore the cursor position. "saved_cursor" will
// be adjusted for the text formatting.
saved_cursor = pos;
format_lines((linenr_T) - 1, false);
format_lines(-1, false);
curwin->w_cursor = saved_cursor;
saved_cursor.lnum = 0;