fix(extmark_to_array): convert conceal_char to bytes

conceal_char is the codepoint of the character.  Using it directly as
the string isn't valid if the character is non-ascii or on big-endian
systems.
This commit is contained in:
James McCoy 2023-12-18 17:38:24 -05:00
parent ad8bd45207
commit 13f8bc4257
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

@ -222,7 +222,9 @@ static Array extmark_to_array(const ExtmarkInfo *extmark, bool id, bool add_dict
}
if (decor->conceal) {
String name = cstr_to_string((char *)&decor->conceal_char);
char bytes[MB_MAXCHAR + 1] = {0};
utf_char2bytes(decor->conceal_char, bytes);
String name = cstr_to_string(bytes);
PUT(dict, "conceal", STRING_OBJ(name));
}