diff options
author | Kevin Ballard <kevin@sb.org> | 2014-08-20 22:31:58 -0700 |
---|---|---|
committer | Kevin Ballard <kevin@sb.org> | 2014-08-20 22:34:18 -0700 |
commit | b0be15d4f7eb47f9d7543ab1c8bb4a830f56aa4c (patch) | |
tree | ddc02e8fe6603b7b7b5514e75a82d8639a0df5ce /highlight.cpp | |
parent | a24998abac2cd9e0e91e8fed23a32742a3c2bd10 (diff) |
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.
Diffstat (limited to 'highlight.cpp')
-rw-r--r-- | highlight.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/highlight.cpp b/highlight.cpp index f560264c..9d43f8e0 100644 --- a/highlight.cpp +++ b/highlight.cpp @@ -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 |