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:
Kevin Ballard 2014-08-20 22:31:58 -07:00
parent a24998abac
commit b0be15d4f7

View file

@ -880,7 +880,7 @@ static void color_argument_internal(const wcstring &buffstr, std::vector<highlig
if (in_pos + 1 < buff_len) if (in_pos + 1 < buff_len)
{ {
const wchar_t escaped_char = buffstr.at(in_pos + 1); 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] = highlight_spec_escape; //backslash
colors[in_pos + 1] = highlight_spec_escape; //escaped char colors[in_pos + 1] = highlight_spec_escape; //escaped char