Skip to content

Commit

Permalink
Update packages/cursorless-engine/src/processTargets/targets/util/ins…
Browse files Browse the repository at this point in the history
…ertionRemovalBehaviors/getSmartRemovalTarget.ts
  • Loading branch information
phillco authored Jan 29, 2025
1 parent 491b2ee commit e14e31a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import { LineTarget } from "../../LineTarget";
import { ParagraphTarget } from "../../ParagraphTarget";
import { TokenTarget } from "../../TokenTarget";

/**
* For targets that don't provide a removal range, we can effectively duck-type one if its content
* range matches that of a token, line, paragraph, or document. If so, we can use the removal range
* for a target of that type.
*/
export function getSmartRemovalTarget(target: Target): Target {
const { editor, isReversed } = target;
const { document } = editor;
Expand Down

0 comments on commit e14e31a

Please sign in to comment.