Skip to content

Commit

Permalink
Fix bug with "every token inside"
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasArvidsson committed Jan 26, 2025
1 parent 181cd9f commit 64f6033
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
26 changes: 26 additions & 0 deletions data/fixtures/recorded/everyScope/changeEveryTokenInside.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
languageId: plaintext
command:
version: 7
spokenForm: change every token inside
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: everyScope
scopeType: {type: token}
- {type: interiorOnly}
usePrePhraseSnapshot: false
initialState:
documentContents: "\"hello world\""
selections:
- anchor: {line: 0, character: 1}
active: {line: 0, character: 1}
marks: {}
finalState:
documentContents: "\" \""
selections:
- anchor: {line: 0, character: 1}
active: {line: 0, character: 1}
- anchor: {line: 0, character: 2}
active: {line: 0, character: 2}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export class EveryScopeStage implements ModifierStage {

if (
scopes.length === 1 &&
scopes[0].domain.contains(target.contentRange)
scopes[0].domain.contains(target.contentRange) &&
!target.hasExplicitScopeType
) {
// If the only scope that came back completely contains the input target
// range, we treat the input as if it had no explicit range, expanding
Expand Down

0 comments on commit 64f6033

Please sign in to comment.