mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 10:31:14 -03:00
Teach fish_indent to only indent and unindent
To be used in the following commits.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user