Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
terminal: Fix issues with highlighted ranges of paths (#26695)
Ben Kunkle18fcdf1d2c00
diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rsindex f7adfd6088a..ca722cd07e8 100644--- a/crates/terminal/src/terminal.rs+++ b/crates/terminal/src/terminal.rs@@ -935,12 +935,19 @@ impl Terminal {if is_path_surrounded_by_common_symbols(&file_path) {word_match = Match::new(- word_match.start().add(term, Boundary::Cursor, 1),- word_match.end().sub(term, Boundary::Cursor, 1),+ word_match.start().add(term, Boundary::Grid, 1),+ word_match.end().sub(term, Boundary::Grid, 1),);file_path = file_path[1..file_path.len() - 1].to_owned();}+ while file_path.ends_with(':') {+ file_path.pop();+ word_match = Match::new(+ *word_match.start(),+ word_match.end().sub(term, Boundary::Grid, 1),+ );+ }let mut colon_count = 0;for c in file_path.chars() {if c == ':' {@@ -966,7 +973,7 @@ impl Terminal {let stripped_len = file_path.len() - last_index;word_match = Match::new(*word_match.start(),- word_match.end().sub(term, Boundary::Cursor, stripped_len),+ word_match.end().sub(term, Boundary::Grid, stripped_len),);file_path = file_path[0..last_index].to_owned();}