cursorless
cursorless copied to clipboard
"break" action doesn't use correct indentation
Our new "break" action for splitting lines doesn't properly indent, because it doesn't use the LSP. For example, in the following talonscript:
aaa: bbb
Saying "break bat" results in
aaa:
bbb
instead of the desired
aaa:
bbb
We should prob implement this similar to how we implement "pour": just go to the spot, press enter, and move away. Though I'm not sure that's possible extension-side? Might need to do it from Talon.
And tbh it's not uncommon that I want to leave my cursor there anyway. I've gone back to my old implementation for now:
break <user.cursorless_target>:
user.cursorless_command("setSelectionBefore", cursorless_target)
user.vscode("hideSuggestWidget")
key("enter")
For pour we don't actually press enter from Talon. Vscode has a built in action to add a new line that we utilize. We could probably do the same thing here.
No I don't think that would work because it doesn't break the line. I guess we could delete the tail, then run that action, then insert the tail on the new line?
Tho I think even that won't work because I believe if you press enter in the middle of parens it puts the closing paren on the line after the new line, dedented
Something like that could work