From 0d726603ceac68be562147faac4ef49e843ed6da Mon Sep 17 00:00:00 2001 From: Smit Barmase Date: Thu, 8 May 2025 00:47:00 +0530 Subject: [PATCH] editor: Fix punctuation in JSX tags breaks the linked edit to the closing tag (#30167) Closes #29983 While we only care about `.`, just enabling punctuation in case of linked edits shouldn't hurt. Release Notes: - Fixed JSX component names with periods (e.g., ) now maintain linked edits between opening and closing tags. --- crates/editor/src/editor.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 236bfa044121f7f50fcc0ae169a9e410c72c16aa..82e3ea78141bb38fb9eaf2abd92a435b5af6f4db 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -3631,7 +3631,9 @@ impl Editor { let start_anchor = snapshot.anchor_before(selection.start); let is_word_char = text.chars().next().map_or(true, |char| { - let classifier = snapshot.char_classifier_at(start_anchor.to_offset(&snapshot)); + let classifier = snapshot + .char_classifier_at(start_anchor.to_offset(&snapshot)) + .ignore_punctuation(true); classifier.is_word(char) });