1
0
forked from aniani/vim

patch 9.1.1263: string length wrong in get_last_inserted_save()

Problem:  string length wrong in get_last_inserted_save()
          (after v9.1.1222)
Solution: when removing trailing ESC, also decrease the string length
          (Christ van Willegen)

closes: #16961

Signed-off-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christ van Willegen
2025-03-30 15:26:01 +02:00
committed by Christian Brabandt
parent f13c856154
commit 583f5aee96
2 changed files with 3 additions and 1 deletions

View File

@@ -3022,7 +3022,7 @@ get_last_insert_save(void)
return NULL;
if (insert.length > 0 && s[insert.length - 1] == ESC) // remove trailing ESC
s[insert.length - 1] = NUL;
s[--insert.length] = NUL;
return s;
}

View File

@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1263,
/**/
1262,
/**/