mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 08:21:56 +08:00
fish_indent: indent line continuations
For example: cmd \ arg Fixes one case from #7252
This commit is contained in:
parent
e2a26b2fdf
commit
9a53bf7d56
@ -400,6 +400,10 @@ struct pretty_printer_t {
|
||||
output.append(L" ");
|
||||
}
|
||||
output.append(L"\\\n");
|
||||
// Indent the line continuation (#7252).
|
||||
current_indent += 1;
|
||||
emit_space_or_indent();
|
||||
current_indent -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -248,6 +248,25 @@ end
|
||||
#CHECK: {{ }}# comment
|
||||
#CHECK: end
|
||||
|
||||
echo -n '
|
||||
cmd \\
|
||||
continuation
|
||||
' | $fish_indent
|
||||
#CHECK: cmd \
|
||||
#CHECK: {{ }}continuation
|
||||
|
||||
echo -n '
|
||||
begin
|
||||
cmd \
|
||||
continuation
|
||||
end
|
||||
' | $fish_indent
|
||||
#CHECK: begin
|
||||
#CHECK: {{ }}cmd \
|
||||
#CHECK: {{ }}{{ }}continuation
|
||||
#CHECK: end
|
||||
|
||||
|
||||
echo -n '
|
||||
i\
|
||||
f true
|
||||
|
Loading…
x
Reference in New Issue
Block a user