([targets]: [TypedSelection[]])
| 18 | } |
| 19 | |
| 20 | async run([targets]: [TypedSelection[]]): Promise<ActionReturnValue> { |
| 21 | await runOnTargetsForEachEditor(targets, async (editor, targets) => { |
| 22 | // Remove selections with a non-empty intersection |
| 23 | const newSelections = editor.selections.filter( |
| 24 | (selection) => |
| 25 | !targets.some((target) => { |
| 26 | const intersection = |
| 27 | target.selection.selection.intersection(selection); |
| 28 | return intersection && (!intersection.isEmpty || selection.isEmpty); |
| 29 | }) |
| 30 | ); |
| 31 | // The editor requires at least one selection. Keep "primary" selection active |
| 32 | editor.selections = newSelections.length |
| 33 | ? newSelections |
| 34 | : [new Selection(editor.selection.active, editor.selection.active)]; |
| 35 | }); |
| 36 | |
| 37 | return { |
| 38 | thatMark: targets.map((target) => target.selection), |
| 39 | }; |
| 40 | } |
| 41 | } |
nothing calls this directly
no test coverage detected