mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 21:21:15 -03:00
Fix highlighting of "foo\"bar"
The backslash-escape wasn't being properly caught by the highlighter. Also remove the highlighting of `"\'"`, as `\'` is not a valid escape in double-quotes, and add highlighting for a backslash-escaped newline.
This commit is contained in:
@@ -880,7 +880,7 @@ static void color_argument_internal(const wcstring &buffstr, std::vector<highlig
|
||||
if (in_pos + 1 < buff_len)
|
||||
{
|
||||
const wchar_t escaped_char = buffstr.at(in_pos + 1);
|
||||
if (escaped_char == L'\\' || escaped_char == L'\'' || escaped_char == L'$')
|
||||
if (wcschr(L"\\\"\n$", escaped_char))
|
||||
{
|
||||
colors[in_pos] = highlight_spec_escape; //backslash
|
||||
colors[in_pos + 1] = highlight_spec_escape; //escaped char
|
||||
|
||||
Reference in New Issue
Block a user