vim-patch:9.2.0645: Composing chars no longer accepted in end-id abbr

Problem:  Composing chars are no longer accepted in end-id abbreviation
          (after 9.2.0629).
Solution: Unescape all chars using vim_unescape_csi() instead of using
          mb_unescape() on individual chars, so that mb_ptr2len() and
          MB_PTR_ADV() can still be used.

closes: vim/vim#20514

23a84d28a8
This commit is contained in:
zeertzjq
2026-06-15 08:06:50 +08:00
parent 0c63e41b5d
commit 2fe91d0225
3 changed files with 27 additions and 15 deletions

View File

@@ -850,7 +850,8 @@ char *vim_strsave_escape_ks(char *p)
/// Remove escaping from K_SPECIAL characters. Reverse of
/// vim_strsave_escape_ks(). Works in-place.
void vim_unescape_ks(char *p)
/// Returns the number of bytes in the unescaped string.
size_t vim_unescape_ks(char *p)
{
uint8_t *s = (uint8_t *)p;
uint8_t *d = (uint8_t *)p;
@@ -864,4 +865,5 @@ void vim_unescape_ks(char *p)
}
}
*d = NUL;
return (size_t)((char *)d - p);
}