mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
vim-patch:9.0.1244: cursor displayed in wrong position when leaving Insert mode (#21996)
Problem: Cursor briefly displayed in a wrong position when pressing Esc in
Insert mode after autoindent was used.
Solution: Do not adjust the cursor position for assumed deleted white space
if text is following. (closes vim/vim#11877)
0f843ef091
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -2526,10 +2526,12 @@ static int vgetorpeek(bool advance)
|
|||||||
// move cursor left, if possible
|
// move cursor left, if possible
|
||||||
if (curwin->w_cursor.col != 0) {
|
if (curwin->w_cursor.col != 0) {
|
||||||
if (curwin->w_wcol > 0) {
|
if (curwin->w_wcol > 0) {
|
||||||
if (did_ai) {
|
// After auto-indenting and no text is following,
|
||||||
// We are expecting to truncate the trailing
|
// we are expecting to truncate the trailing
|
||||||
// white-space, so find the last non-white
|
// white-space, so find the last non-white
|
||||||
// character -- webb
|
// character -- webb
|
||||||
|
if (did_ai
|
||||||
|
&& *skipwhite(get_cursor_line_ptr() + curwin->w_cursor.col) == NUL) {
|
||||||
curwin->w_wcol = 0;
|
curwin->w_wcol = 0;
|
||||||
ptr = (char_u *)get_cursor_line_ptr();
|
ptr = (char_u *)get_cursor_line_ptr();
|
||||||
chartabsize_T cts;
|
chartabsize_T cts;
|
||||||
|
Reference in New Issue
Block a user