diff --git a/src/row.rs b/src/row.rs index 3384563..57da1cb 100644 --- a/src/row.rs +++ b/src/row.rs @@ -235,6 +235,14 @@ impl Row { if opts.strings() { if in_string { highlighting.push(highlighting::Type::String); + + // Don't let an escaped character stop string highlighting + if *c == '\\' && index < self.len().saturating_sub(1) { + highlighting.push(highlighting::Type::String); + index += 2; + continue; + } + if *c == '"' { in_string = false; prev_is_separator = true; @@ -256,8 +264,8 @@ impl Row { if opts.numbers() { if (c.is_ascii_digit() - && (prev_is_separator || previous_highlight == &highlighting::Type::Number)) - || (c == &'.' && previous_highlight == &highlighting::Type::Number) + && (prev_is_separator || *previous_highlight == highlighting::Type::Number)) + || (*c == '.' && *previous_highlight == highlighting::Type::Number) { highlighting.push(highlighting::Type::Number) } else {