diff --git a/src/editor.rs b/src/editor.rs index e192034..f109b2d 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -637,10 +637,10 @@ impl Editor { Keyword1 => 33, // Yellow Keyword2 => 32, // Green LineComment => 36, // Cyan - MultiLineComment => 36, // Cyan - Normal => 37, + MultiLineComment => 34, // Blue + Normal => 37, // White Number => 31, // Red - SearchMatch => 34, // Blue + SearchMatch => 7, // Reverse! String => 35, // Magenta } } @@ -979,6 +979,7 @@ impl Editor { } } else if self.rows[file_row].highlight[x] == Highlight::Normal { if current_color != -1 { + self.append_out("\x1b[0m"); self.append_out("\x1b[39m"); current_color = -1; } @@ -988,11 +989,13 @@ impl Editor { if color != current_color { current_color = color; let code = format!("\x1b[{}m", color); + self.append_out("\x1b[0m"); self.append_out(&code); } self.append_out_char(ch); } } + self.append_out("\x1b[0m"); self.append_out("\x1b[39m"); }