Skip to content
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
@@ -0,0 +1,6 @@
---
tags: [enhancement]
pullRequest: 2646
---

`drop`, `float` and `puff` now behave like `drink` and `pour` for non-line targets: for example, `"puff token"` will insert spaces around the token; `"float item"` will insert `,`s as needed, and so on.
30 changes: 30 additions & 0 deletions data/fixtures/recorded/actions/insertEmptyLines/dropToken.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
languageId: plaintext
command:
version: 7
spokenForm: drop token
action:
name: insertEmptyLineBefore
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: token}
usePrePhraseSnapshot: true
initialState:
documentContents: foo
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
marks: {}
finalState:
documentContents: " foo"
selections:
- anchor: {line: 0, character: 1}
active: {line: 0, character: 1}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 0, character: 1}
end: {line: 0, character: 4}
isReversed: false
hasExplicitRange: true
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ finalState:
documentContents: |+

selections:
- anchor: {line: 1, character: 0}
active: {line: 1, character: 0}
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 1, character: 0}
end: {line: 1, character: 0}
start: {line: 0, character: 0}
end: {line: 0, character: 0}
isReversed: false
hasExplicitRange: true
ide:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ finalState:

hello
selections:
- anchor: {line: 2, character: 0}
active: {line: 2, character: 0}
- anchor: {line: 1, character: 9}
active: {line: 1, character: 9}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 2, character: 0}
end: {line: 2, character: 0}
start: {line: 1, character: 9}
end: {line: 1, character: 9}
isReversed: false
hasExplicitRange: true
ide:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ finalState:
documentContents: |
hello
selections:
- anchor: {line: 1, character: 0}
active: {line: 1, character: 0}
- anchor: {line: 0, character: 5}
active: {line: 0, character: 5}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 1, character: 0}
end: {line: 1, character: 0}
start: {line: 0, character: 5}
end: {line: 0, character: 5}
isReversed: false
hasExplicitRange: true
ide:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ finalState:
documentContents: |2
hello
selections:
- anchor: {line: 1, character: 0}
active: {line: 1, character: 0}
- anchor: {line: 0, character: 9}
active: {line: 0, character: 9}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 1, character: 0}
end: {line: 1, character: 0}
start: {line: 0, character: 9}
end: {line: 0, character: 9}
isReversed: false
hasExplicitRange: true
ide:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ finalState:
documentContents: |2

selections:
- anchor: {line: 1, character: 0}
active: {line: 1, character: 0}
- anchor: {line: 0, character: 4}
active: {line: 0, character: 4}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 1, character: 0}
end: {line: 1, character: 0}
start: {line: 0, character: 4}
end: {line: 0, character: 4}
isReversed: false
hasExplicitRange: true
ide:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ finalState:
whatever
hello
selections:
- anchor: {line: 2, character: 0}
active: {line: 2, character: 0}
- anchor: {line: 1, character: 9}
active: {line: 1, character: 9}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 2, character: 0}
end: {line: 2, character: 0}
start: {line: 1, character: 9}
end: {line: 1, character: 9}
isReversed: false
hasExplicitRange: true
ide:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ finalState:
whatever
hello
selections:
- anchor: {line: 2, character: 0}
active: {line: 2, character: 0}
- anchor: {line: 1, character: 5}
active: {line: 1, character: 5}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 2, character: 0}
end: {line: 2, character: 0}
start: {line: 1, character: 5}
end: {line: 1, character: 5}
isReversed: false
hasExplicitRange: true
ide:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ finalState:
hello

selections:
- anchor: {line: 2, character: 0}
active: {line: 2, character: 0}
- anchor: {line: 1, character: 0}
active: {line: 1, character: 0}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 2, character: 0}
end: {line: 2, character: 0}
start: {line: 1, character: 0}
end: {line: 1, character: 0}
isReversed: false
hasExplicitRange: true
ide:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ finalState:
hello

selections:
- anchor: {line: 2, character: 0}
active: {line: 2, character: 0}
- anchor: {line: 1, character: 0}
active: {line: 1, character: 0}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 2, character: 0}
end: {line: 2, character: 0}
start: {line: 1, character: 0}
end: {line: 1, character: 0}
isReversed: false
hasExplicitRange: true
ide:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ finalState:
hello

selections:
- anchor: {line: 2, character: 0}
active: {line: 2, character: 0}
- anchor: {line: 1, character: 4}
active: {line: 1, character: 4}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 2, character: 0}
end: {line: 2, character: 0}
start: {line: 1, character: 4}
end: {line: 1, character: 4}
isReversed: false
hasExplicitRange: true
ide:
Expand Down
30 changes: 30 additions & 0 deletions data/fixtures/recorded/actions/insertEmptyLines/floatToken.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
languageId: plaintext
command:
version: 7
spokenForm: float token
action:
name: insertEmptyLineAfter
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: token}
usePrePhraseSnapshot: true
initialState:
documentContents: foo
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
marks: {}
finalState:
documentContents: "foo "
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 0, character: 0}
end: {line: 0, character: 3}
isReversed: false
hasExplicitRange: true
10 changes: 5 additions & 5 deletions data/fixtures/recorded/actions/insertEmptyLines/puffThis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ finalState:


selections:
- anchor: {line: 2, character: 0}
active: {line: 2, character: 0}
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 2, character: 0}
end: {line: 2, character: 0}
start: {line: 0, character: 0}
end: {line: 0, character: 0}
isReversed: false
hasExplicitRange: true
ide:
flashes:
- style: justAdded
range: {type: line, start: 1, end: 1}
range: {type: line, start: 0, end: 0}
- style: justAdded
range: {type: line, start: 1, end: 1}
10 changes: 5 additions & 5 deletions data/fixtures/recorded/actions/insertEmptyLines/puffThis10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ finalState:


selections:
- anchor: {line: 3, character: 0}
active: {line: 3, character: 0}
- anchor: {line: 2, character: 4}
active: {line: 2, character: 4}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 3, character: 0}
end: {line: 3, character: 0}
start: {line: 2, character: 4}
end: {line: 2, character: 4}
isReversed: false
hasExplicitRange: true
ide:
flashes:
- style: justAdded
range: {type: line, start: 1, end: 1}
- style: justAdded
range: {type: line, start: 2, end: 2}
range: {type: line, start: 3, end: 3}
10 changes: 5 additions & 5 deletions data/fixtures/recorded/actions/insertEmptyLines/puffThis11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ finalState:

hello
selections:
- anchor: {line: 3, character: 0}
active: {line: 3, character: 0}
- anchor: {line: 2, character: 9}
active: {line: 2, character: 9}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 3, character: 0}
end: {line: 3, character: 0}
start: {line: 2, character: 9}
end: {line: 2, character: 9}
isReversed: false
hasExplicitRange: true
ide:
flashes:
- style: justAdded
range: {type: line, start: 1, end: 1}
- style: justAdded
range: {type: line, start: 2, end: 2}
range: {type: line, start: 3, end: 3}
10 changes: 5 additions & 5 deletions data/fixtures/recorded/actions/insertEmptyLines/puffThis19.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ finalState:


selections:
- anchor: {line: 2, character: 0}
active: {line: 2, character: 0}
- anchor: {line: 1, character: 0}
active: {line: 1, character: 0}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 2, character: 0}
end: {line: 2, character: 0}
start: {line: 1, character: 0}
end: {line: 1, character: 0}
isReversed: false
hasExplicitRange: true
ide:
flashes:
- style: justAdded
range: {type: line, start: 1, end: 1}
- style: justAdded
range: {type: line, start: 3, end: 3}
range: {type: line, start: 2, end: 2}
10 changes: 5 additions & 5 deletions data/fixtures/recorded/actions/insertEmptyLines/puffThis2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ finalState:

hello
selections:
- anchor: {line: 2, character: 0}
active: {line: 2, character: 0}
- anchor: {line: 1, character: 5}
active: {line: 1, character: 5}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 2, character: 0}
end: {line: 2, character: 0}
start: {line: 1, character: 5}
end: {line: 1, character: 5}
isReversed: false
hasExplicitRange: true
ide:
flashes:
- style: justAdded
range: {type: line, start: 0, end: 0}
- style: justAdded
range: {type: line, start: 1, end: 1}
range: {type: line, start: 2, end: 2}
10 changes: 5 additions & 5 deletions data/fixtures/recorded/actions/insertEmptyLines/puffThis20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ finalState:

there
selections:
- anchor: {line: 2, character: 0}
active: {line: 2, character: 0}
- anchor: {line: 1, character: 0}
active: {line: 1, character: 0}
thatMark:
- type: UntypedTarget
contentRange:
start: {line: 2, character: 0}
end: {line: 2, character: 0}
start: {line: 1, character: 0}
end: {line: 1, character: 0}
isReversed: false
hasExplicitRange: true
ide:
flashes:
- style: justAdded
range: {type: line, start: 1, end: 1}
- style: justAdded
range: {type: line, start: 3, end: 3}
range: {type: line, start: 2, end: 2}
Loading