> Hi,
>
> I would argue that:
>
> - if (insert->length > 0)
> - {
> - // remove trailing ESC
> - --insert->length;
> - if (s[insert->length] == ESC)
> - s[insert->length] = NUL;
> - }
> + if (insert.length > 0 && s[insert.length - 1] == ESC) // remove trailing
> ESC
> + s[insert.length - 1] = NUL
patch 9.1.1222: using wrong length for last inserted string
Commit:
https://github.com/vim/vim/commit/8ac0f73eb1e0e6128dd21eb294d12b83b615f05a
Author: John Marriott
Date: Tue Mar 18 20:49:01 2025 +0100
patch 9.1.1222: using wrong length for last inserted string
Problem: using wr
Hi,
I would argue that:
- if (insert->length > 0)
- {
- // remove trailing ESC
- --insert->length;
- if (s[insert->length] == ESC)
- s[insert->length] = NUL;
- }
+ if (insert.length > 0 && s[insert.length - 1] == ESC) // remove trailing
ESC
+ s[insert.length - 1] = NUL;
return s;
still does