• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Révisiona5c68c2e5ae87e5c91d81240fbc2409014530189 (tree)
l'heure2023-01-26 02:45:04
AuteurBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Message de Log

patch 9.0.1244: cursor displayed in wrong position when leaving Insert mode

Commit: https://github.com/vim/vim/commit/0f843ef091eceb470caece1d90fdfe08926fe076
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jan 25 17:34:41 2023 +0000

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)

Change Summary

Modification

diff -r 2f25be7e01fd -r a5c68c2e5ae8 src/getchar.c
--- a/src/getchar.c Wed Jan 25 16:45:04 2023 +0100
+++ b/src/getchar.c Wed Jan 25 18:45:04 2023 +0100
@@ -3328,15 +3328,15 @@
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,
diff -r 2f25be7e01fd -r a5c68c2e5ae8 src/version.c
--- a/src/version.c Wed Jan 25 16:45:04 2023 +0100
+++ b/src/version.c Wed Jan 25 18:45:04 2023 +0100
@@ -696,6 +696,8 @@
696696 static int included_patches[] =
697697 { /* Add new patch number below this line */
698698 /**/
699+ 1244,
700+/**/
699701 1243,
700702 /**/
701703 1242,
Afficher sur ancien navigateur de dépôt.