mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07: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:
parent
b05100a9ea
commit
c94d8e7f13
@ -2526,10 +2526,12 @@ static int vgetorpeek(bool advance)
|
||||
// move cursor left, if possible
|
||||
if (curwin->w_cursor.col != 0) {
|
||||
if (curwin->w_wcol > 0) {
|
||||
if (did_ai) {
|
||||
// We are expecting to truncate the trailing
|
||||
// white-space, so find the last non-white
|
||||
// character -- webb
|
||||
// After auto-indenting and no text is following,
|
||||
// we are expecting to truncate the trailing
|
||||
// white-space, so find the last non-white
|
||||
// character -- webb
|
||||
if (did_ai
|
||||
&& *skipwhite(get_cursor_line_ptr() + curwin->w_cursor.col) == NUL) {
|
||||
curwin->w_wcol = 0;
|
||||
ptr = (char_u *)get_cursor_line_ptr();
|
||||
chartabsize_T cts;
|
||||
|
Loading…
Reference in New Issue
Block a user