fish_indent: indent line continuations

For example:

    cmd \
        arg

Fixes one case from #7252
This commit is contained in:
ridiculousfish 2020-08-08 18:29:50 -07:00
parent e2a26b2fdf
commit 9a53bf7d56
2 changed files with 23 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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