-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow whitespace lines when calculating edit indentation (#2511)
When calculating the edit indentation we want to skip empty lines, but whitespace lines we should actually use. ## Checklist - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [/] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [/] I have not broken the cheatsheet --------- Co-authored-by: Pokey Rule <[email protected]>
- Loading branch information
1 parent
6f05cb2
commit 08d8c0a
Showing
4 changed files
with
124 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
languageId: plaintext | ||
command: | ||
version: 7 | ||
spokenForm: drink line | ||
action: | ||
name: editNewLineBefore | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: line} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
def my_funk(): | ||
pass | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
def my_funk(): | ||
pass | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
thatMark: | ||
- type: UntypedTarget | ||
contentRange: | ||
start: {line: 2, character: 0} | ||
end: {line: 2, character: 4} | ||
isReversed: false | ||
hasExplicitRange: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
languageId: typescript | ||
command: | ||
version: 7 | ||
spokenForm: pour funk | ||
action: | ||
name: editNewLineAfter | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: namedFunction} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |2- | ||
function foo() { | ||
} | ||
selections: | ||
- anchor: {line: 1, character: 2} | ||
active: {line: 1, character: 2} | ||
marks: {} | ||
finalState: | ||
documentContents: |2- | ||
function foo() { | ||
} | ||
selections: | ||
- anchor: {line: 4, character: 4} | ||
active: {line: 4, character: 4} | ||
thatMark: | ||
- type: UntypedTarget | ||
contentRange: | ||
start: {line: 0, character: 4} | ||
end: {line: 2, character: 5} | ||
isReversed: false | ||
hasExplicitRange: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
languageId: plaintext | ||
command: | ||
version: 7 | ||
spokenForm: pour line | ||
action: | ||
name: editNewLineAfter | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: line} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
def my_funk(): | ||
pass | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
def my_funk(): | ||
pass | ||
selections: | ||
- anchor: {line: 2, character: 4} | ||
active: {line: 2, character: 4} | ||
thatMark: | ||
- type: UntypedTarget | ||
contentRange: | ||
start: {line: 1, character: 0} | ||
end: {line: 1, character: 4} | ||
isReversed: false | ||
hasExplicitRange: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters