mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
vim-patch:8.2.3522: cannot use \x and \u when setting 'listchars' (#16049)
Problem: Cannot use \x and \u when setting 'listchars'.
Solution: Support hex and unicode in hex form. (closes vim/vim#9006)
93ff6720fe
This commit is contained in:
@@ -1642,6 +1642,16 @@ int hex2nr(int c)
|
||||
return c - '0';
|
||||
}
|
||||
|
||||
/// Convert two hex characters to a byte.
|
||||
/// Return -1 if one of the characters is not hex.
|
||||
int hexhex2nr(char_u *p)
|
||||
{
|
||||
if (!ascii_isxdigit(p[0]) || !ascii_isxdigit(p[1])) {
|
||||
return -1;
|
||||
}
|
||||
return (hex2nr(p[0]) << 4) + hex2nr(p[1]);
|
||||
}
|
||||
|
||||
/// Check that "str" starts with a backslash that should be removed.
|
||||
/// For Windows this is only done when the character after the
|
||||
/// backslash is not a normal file name character.
|
||||
|
Reference in New Issue
Block a user