Skip to content

Commit 2faccb0

Browse files
Remove document upgrade
1 parent e14e31a commit 2faccb0

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

packages/cursorless-engine/src/processTargets/targets/util/insertionRemovalBehaviors/getSmartRemovalTarget.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import type { Range, TextDocument, TextEditor } from "@cursorless/common";
1+
import type { Range, TextDocument } from "@cursorless/common";
22
import type { Target } from "../../../../typings/target.types";
33
import { union } from "../../../../util/rangeUtils";
4-
import { shrinkRangeToFitContent } from "../../../../util/selectionUtils";
5-
import { DocumentTarget } from "../../DocumentTarget";
64
import { LineTarget } from "../../LineTarget";
75
import { ParagraphTarget } from "../../ParagraphTarget";
86
import { TokenTarget } from "../../TokenTarget";
@@ -25,14 +23,6 @@ export function getSmartRemovalTarget(target: Target): Target {
2523
});
2624
}
2725

28-
if (isDocument(editor, contentRange)) {
29-
return new DocumentTarget({
30-
editor,
31-
isReversed,
32-
contentRange: document.range,
33-
});
34-
}
35-
3626
if (isParagraph(document, contentRange)) {
3727
return new ParagraphTarget({
3828
editor,
@@ -67,11 +57,3 @@ function isParagraph(document: TextDocument, contentRange: Range): boolean {
6757
document.lineAt(end.line + 1).isEmptyOrWhitespace)
6858
);
6959
}
70-
71-
function isDocument(editor: TextEditor, contentRange: Range): boolean {
72-
const documentContentRange = shrinkRangeToFitContent(
73-
editor,
74-
editor.document.range,
75-
);
76-
return documentContentRange.isRangeEqual(contentRange);
77-
}

0 commit comments

Comments
 (0)