From c53e5ba3977f46779a78551f09f10107bed853d8 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 24 Sep 2025 10:30:11 +0200 Subject: [PATCH] editor: Fix invalid anchors in `hover_links::surrounding_filename` (#38766) Fixes ZED-1K3 Release Notes: - N/A *or* Added/Fixed/Improved ... --- crates/editor/src/hover_links.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/editor/src/hover_links.rs b/crates/editor/src/hover_links.rs index 2b91f8cb1ca4c515d2f09997f07b42d611b4baaf..7dad9f28e4b2767945f7f0aa4941c4862255c2a4 100644 --- a/crates/editor/src/hover_links.rs +++ b/crates/editor/src/hover_links.rs @@ -898,6 +898,7 @@ fn surrounding_filename( } else { // Otherwise, we skip the quote inside_quotes = true; + token_end += ch.len_utf8(); continue; } } @@ -1545,6 +1546,10 @@ mod tests { ("'fˇile.txt'", Some("file.txt")), ("ˇ'file.txt'", Some("file.txt")), ("ˇ'fi\\ le.txt'", Some("fi le.txt")), + // Quoted multibyte characters + (" ˇ\"常\"", Some("常")), + (" \"ˇ常\"", Some("常")), + ("ˇ\"常\"", Some("常")), ]; for (input, expected) in test_cases {