mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
fish_indent: indent line continuations
For example: cmd \ arg Fixes one case from #7252
This commit is contained in:
parent
e2a26b2fdf
commit
9a53bf7d56
2 changed files with 23 additions and 0 deletions
|
@ -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…
Reference in a new issue