Skip to content

Commit 0f843ef

Browse files
committed
patch 9.0.1244: cursor displayed in wrong position when leaving Insert mode
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 #11877)
1 parent 01d4efe commit 0f843ef

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/getchar.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3328,15 +3328,15 @@ vgetorpeek(int advance)
33283328
{
33293329
if (curwin->w_wcol > 0)
33303330
{
3331-
if (did_ai)
3331+
// After auto-indenting and no text is following,
3332+
// we are expecting to truncate the trailing
3333+
// white-space, so find the last non-white
3334+
// character -- webb
3335+
if (did_ai && *skipwhite(ml_get_curline()
3336+
+ curwin->w_cursor.col) == NUL)
33323337
{
33333338
chartabsize_T cts;
33343339

3335-
/*
3336-
* We are expecting to truncate the trailing
3337-
* white-space, so find the last non-white
3338-
* character -- webb
3339-
*/
33403340
curwin->w_wcol = 0;
33413341
ptr = ml_get_curline();
33423342
init_chartabsize_arg(&cts, curwin,

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,8 @@ static char *(features[]) =
695695

696696
static int included_patches[] =
697697
{ /* Add new patch number below this line */
698+
/**/
699+
1244,
698700
/**/
699701
1243,
700702
/**/

0 commit comments

Comments
 (0)