Skip to content

Fix "instance first three chars" #1520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@ export default class PlainTarget extends BaseTarget {
getTrailingDelimiterTarget = () => undefined;
getRemovalRange = () => this.contentRange;

protected getCloneParameters = () => this.state;
protected getCloneParameters() {
return {
...this.state,
isToken: this.isToken,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really gotta figure out a way to make the clone parameters have a stronger type. Forgetting to include custom parameters is something that has hit us multiple times

};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
languageId: plaintext
command:
version: 5
spokenForm: clear two instances first three cars air
action: {name: clearAndSetSelection}
targets:
- type: primitive
modifiers:
- type: relativeScope
scopeType: {type: instance}
offset: 0
length: 2
direction: forward
- type: ordinalScope
scopeType: {type: character}
start: 0
length: 3
mark: {type: decoratedSymbol, symbolColor: default, character: a}
usePrePhraseSnapshot: true
initialState:
documentContents: |
aaabbb aaaccc
selections:
- anchor: {line: 1, character: 0}
active: {line: 1, character: 0}
marks:
default.a:
start: {line: 0, character: 0}
end: {line: 0, character: 6}
finalState:
documentContents: |
bbb ccc
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
- anchor: {line: 0, character: 4}
active: {line: 0, character: 4}