editor: Fix adding extraneous closing tags within TSX (#38534)

This commit is contained in:
Smit Barmase
2025-09-20 04:40:22 +05:30
committed by GitHub
parent 8df616e28b
commit be77682a3f
13 changed files with 218 additions and 84 deletions
+5 -2
View File
@@ -30,7 +30,9 @@ use gpui::{
Render, Subscription, Task, WeakEntity, Window, actions,
};
use insert::{NormalBefore, TemporaryNormal};
use language::{CharKind, CursorShape, Point, Selection, SelectionGoal, TransactionId};
use language::{
CharKind, CharScopeContext, CursorShape, Point, Selection, SelectionGoal, TransactionId,
};
pub use mode_indicator::ModeIndicator;
use motion::Motion;
use normal::search::SearchSubmit;
@@ -1347,7 +1349,8 @@ impl Vim {
let selection = editor.selections.newest::<usize>(cx);
let snapshot = &editor.snapshot(window, cx).buffer_snapshot;
let (range, kind) = snapshot.surrounding_word(selection.start, true);
let (range, kind) =
snapshot.surrounding_word(selection.start, Some(CharScopeContext::Completion));
if kind == Some(CharKind::Word) {
let text: String = snapshot.text_for_range(range).collect();
if !text.trim().is_empty() {