Skip to content

Commit c4a1ed8

Browse files
authored
Delete agent, slash command, variable more easily (microsoft#204651)
1 parent 45a573e commit c4a1ed8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,8 @@ class ChatTokenDeleter extends Disposable {
646646
const deletableTokens = previousParsedValue.parts.filter(p => p instanceof ChatRequestAgentPart || p instanceof ChatRequestAgentSubcommandPart || p instanceof ChatRequestSlashCommandPart || p instanceof ChatRequestVariablePart);
647647
deletableTokens.forEach(token => {
648648
const deletedRangeOfToken = Range.intersectRanges(token.editorRange, change.range);
649-
// Part of this token was deleted, and the deletion range doesn't go off the front of the token, for simpler math
650-
if ((deletedRangeOfToken && !deletedRangeOfToken.isEmpty()) && Range.compareRangesUsingStarts(token.editorRange, change.range) < 0) {
649+
// Part of this token was deleted, or the space after it was deleted, and the deletion range doesn't go off the front of the token, for simpler math
650+
if (deletedRangeOfToken && Range.compareRangesUsingStarts(token.editorRange, change.range) < 0) {
651651
// Assume single line tokens
652652
const length = deletedRangeOfToken.endColumn - deletedRangeOfToken.startColumn;
653653
const rangeToDelete = new Range(token.editorRange.startLineNumber, token.editorRange.startColumn, token.editorRange.endLineNumber, token.editorRange.endColumn - length);

0 commit comments

Comments
 (0)