editor: Fix adding extraneous closing tags within TSX (#38534)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user