mirror of
https://github.com/cursorless-dev/cursorless.git
synced 2024-10-05 05:17:38 +03:00
Use removal highlight range instead of removal range (#791)
Co-authored-by: Andreas Arvidsson <andreas.arvidsson@redpill-linpro.com>
This commit is contained in:
parent
10c355f556
commit
fde786db0b
@ -50,7 +50,7 @@ class BringMoveSwap implements Action {
|
||||
getSourceRangeCallback = getContentRange;
|
||||
} else if (this.type === "move") {
|
||||
sourceStyle = this.graph.editStyles.pendingDelete;
|
||||
getSourceRangeCallback = getRemovalRange;
|
||||
getSourceRangeCallback = getRemovalHighlightRange;
|
||||
}
|
||||
// NB this.type === "swap"
|
||||
else {
|
||||
@ -282,6 +282,6 @@ export class Swap extends BringMoveSwap {
|
||||
}
|
||||
}
|
||||
|
||||
function getRemovalRange(target: Target) {
|
||||
return target.getRemovalRange();
|
||||
function getRemovalHighlightRange(target: Target) {
|
||||
return target.getRemovalHighlightRange();
|
||||
}
|
||||
|
53
src/test/suite/fixtures/recorded/decorations/moveLineAir.yml
Normal file
53
src/test/suite/fixtures/recorded/decorations/moveLineAir.yml
Normal file
@ -0,0 +1,53 @@
|
||||
languageId: plaintext
|
||||
command:
|
||||
spokenForm: move line air
|
||||
version: 2
|
||||
targets:
|
||||
- type: primitive
|
||||
mark: {type: decoratedSymbol, symbolColor: default, character: a}
|
||||
modifiers:
|
||||
- type: containingScope
|
||||
scopeType: {type: line}
|
||||
- {type: primitive, isImplicit: true}
|
||||
usePrePhraseSnapshot: true
|
||||
action: {name: moveToTarget}
|
||||
initialState:
|
||||
documentContents: |
|
||||
a a a
|
||||
b b b
|
||||
c c c
|
||||
selections:
|
||||
- anchor: {line: 3, character: 0}
|
||||
active: {line: 3, character: 0}
|
||||
marks:
|
||||
default.a:
|
||||
start: {line: 0, character: 0}
|
||||
end: {line: 0, character: 1}
|
||||
finalState:
|
||||
documentContents: |-
|
||||
b b b
|
||||
c c c
|
||||
a a a
|
||||
selections:
|
||||
- anchor: {line: 2, character: 5}
|
||||
active: {line: 2, character: 5}
|
||||
thatMark:
|
||||
- anchor: {line: 2, character: 0}
|
||||
active: {line: 2, character: 5}
|
||||
sourceMark:
|
||||
- anchor: {line: 0, character: 0}
|
||||
active: {line: 0, character: 0}
|
||||
decorations:
|
||||
- name: pendingDeleteBackground
|
||||
type: line
|
||||
start: {line: 0, character: 0}
|
||||
end: {line: 0, character: 5}
|
||||
- name: pendingModification0Background
|
||||
type: token
|
||||
start: {line: 3, character: 0}
|
||||
end: {line: 3, character: 0}
|
||||
- name: pendingModification0Background
|
||||
type: token
|
||||
start: {line: 2, character: 0}
|
||||
end: {line: 2, character: 5}
|
||||
fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: a}, modifiers: [{type: containingScope, scopeType: {type: line}}]}, {type: primitive, mark: {type: cursor}, modifiers: [{type: toRawSelection}]}]
|
Loading…
Reference in New Issue
Block a user