Skip to content

Commit 1e8d19a

Browse files
Updated tests
1 parent 9a34030 commit 1e8d19a

File tree

4 files changed

+69
-2
lines changed

4 files changed

+69
-2
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
languageId: plaintext
2+
command:
3+
version: 7
4+
spokenForm: add post whale
5+
action:
6+
name: addSelectionAfter
7+
target:
8+
type: primitive
9+
mark: {type: decoratedSymbol, symbolColor: default, character: w}
10+
usePrePhraseSnapshot: true
11+
initialState:
12+
documentContents: hello world
13+
selections:
14+
- anchor: {line: 0, character: 0}
15+
active: {line: 0, character: 0}
16+
marks:
17+
default.w:
18+
start: {line: 0, character: 6}
19+
end: {line: 0, character: 11}
20+
finalState:
21+
documentContents: hello world
22+
selections:
23+
- anchor: {line: 0, character: 0}
24+
active: {line: 0, character: 0}
25+
- anchor: {line: 0, character: 11}
26+
active: {line: 0, character: 11}
27+
thatMark:
28+
- type: UntypedTarget
29+
contentRange:
30+
start: {line: 0, character: 6}
31+
end: {line: 0, character: 11}
32+
isReversed: false
33+
hasExplicitRange: false
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
languageId: plaintext
2+
command:
3+
version: 7
4+
spokenForm: add pre whale
5+
action:
6+
name: addSelectionBefore
7+
target:
8+
type: primitive
9+
mark: {type: decoratedSymbol, symbolColor: default, character: w}
10+
usePrePhraseSnapshot: true
11+
initialState:
12+
documentContents: hello world
13+
selections:
14+
- anchor: {line: 0, character: 0}
15+
active: {line: 0, character: 0}
16+
marks:
17+
default.w:
18+
start: {line: 0, character: 6}
19+
end: {line: 0, character: 11}
20+
finalState:
21+
documentContents: hello world
22+
selections:
23+
- anchor: {line: 0, character: 0}
24+
active: {line: 0, character: 0}
25+
- anchor: {line: 0, character: 6}
26+
active: {line: 0, character: 6}
27+
thatMark:
28+
- type: UntypedTarget
29+
contentRange:
30+
start: {line: 0, character: 6}
31+
end: {line: 0, character: 11}
32+
isReversed: false
33+
hasExplicitRange: false

data/fixtures/recorded/actions/appendWhale.yml renamed to data/fixtures/recorded/actions/addWhale.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
languageId: plaintext
22
command:
33
version: 7
4-
spokenForm: append whale
4+
spokenForm: add whale
55
action:
6-
name: appendSelection
6+
name: addSelection
77
target:
88
type: primitive
99
mark: {type: decoratedSymbol, symbolColor: default, character: w}

packages/cursorless-engine/src/actions/SetSelection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ abstract class SetSelectionBase implements SimpleAction {
1010
private rangeMode: "content" | "before" | "after",
1111
) {
1212
this.run = this.run.bind(this);
13+
this.getSelection = this.getSelection.bind(this);
1314
}
1415

1516
async run(targets: Target[]): Promise<ActionReturnValue> {

0 commit comments

Comments
 (0)