mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
vim-patch:8.1.0671: cursor in wrong column after auto-format #9729
Problem: Cursor in the wrong column after auto-formatting.
Solution: Check for deleting more spaces than adding. (closes vim/vim#3748)
e1e714ef0d
This commit is contained in:

committed by
Justin M. Keyes

parent
907b480350
commit
cbe4377fde
@@ -848,10 +848,11 @@ open_line (
|
||||
/* Move marks after the line break to the new line. */
|
||||
if (flags & OPENLINE_MARKFIX)
|
||||
mark_col_adjust(curwin->w_cursor.lnum,
|
||||
curwin->w_cursor.col + less_cols_off,
|
||||
1L, (long)-less_cols);
|
||||
} else
|
||||
curwin->w_cursor.col + less_cols_off,
|
||||
1L, (long)-less_cols, 0);
|
||||
} else {
|
||||
changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user