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:
Jan Edmund Lazo
2019-03-14 06:23:05 -04:00
committed by Justin M. Keyes
parent 907b480350
commit cbe4377fde
4 changed files with 38 additions and 15 deletions

View File

@@ -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);
}
}
/*