mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 02:31:18 -03:00
fish_indent: Allow escaped newlines only for certain things
Things like ```fish \ echo foo ``` or ```fish echo foo; \ echo bar ``` are a formatting blunder and should be handled. This makes it so the escaped newline is removed, and the semicolon/token_type_end handling will then put the statements on different lines. One case this doesn't handle brilliantly is an escaped newline after a pipe: ```fish echo foo | \ cat ``` is turned into ```fish echo foo | cat ``` which here works great, but in long pipelines can cause issues. Pipes at the end of the line cause fish to continue parsing on the next line, so this can just be written as ```fish echo foo | cat ``` for now.
This commit is contained in:
@@ -107,8 +107,7 @@ while true
|
||||
builtin yes
|
||||
end
|
||||
|
||||
alpha | \
|
||||
beta
|
||||
alpha | beta
|
||||
|
||||
gamma | \
|
||||
# comment3
|
||||
|
||||
Reference in New Issue
Block a user