Teach fish_indent to only indent and unindent

To be used in the following commits.
This commit is contained in:
Johannes Altmanninger
2024-04-12 09:16:24 +02:00
parent 7369516871
commit 47a446ae18
6 changed files with 114 additions and 8 deletions

View File

@@ -464,3 +464,35 @@ echo "
echo this file starts late
" | $fish_indent
#CHECK: echo this file starts late
echo 'foo|bar; begin
echo' | $fish_indent --only-indent
# CHECK: foo|bar; begin
# CHECK: {{^}} echo
echo 'begin
echo
end' | $fish_indent --only-unindent
# CHECK: {{^}}begin
# CHECK: {{^}}echo
# CHECK: {{^}}end
echo 'if true
begin
echo
end
end' | $fish_indent --only-unindent
# CHECK: {{^}}if true
# CHECK: {{^}}begin
# CHECK: {{^}}echo
# CHECK: {{^}}end
# CHECK: {{^}}end
echo 'begin
echo
not indented properly
end' | $fish_indent --only-unindent
# CHECK: {{^}}begin
# CHECK: {{^}} echo
# CHECK: {{^}} not indented properly
# CHECK: {{^}}end