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., <Animated.View>) now
maintain linked edits between opening and closing tags.
This commit is contained in:
Smit Barmase 2025-05-08 00:47:00 +05:30 committed by GitHub
parent 466a53b51e
commit 0d726603ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
});