diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2015-12-19 14:45:45 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2015-12-19 14:49:07 -0800 |
commit | 594b460ba2d8dca59a3bfd282397c5f33aa9da6f (patch) | |
tree | 6ed47cc5b6b1015e8680b7ce8cf1b526cd555a95 /src/fish_indent.cpp | |
parent | 0a6f62358b990e1f1c393ce1eb9ce4f978680866 (diff) |
Allow and/or statements to attach to the if/while header
For example:
if false; or true; echo hello; end
will output 'hello' now.
Fixes #1428
Diffstat (limited to 'src/fish_indent.cpp')
-rw-r--r-- | src/fish_indent.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fish_indent.cpp b/src/fish_indent.cpp index 59efbd1e..60ed2334 100644 --- a/src/fish_indent.cpp +++ b/src/fish_indent.cpp @@ -92,7 +92,8 @@ static void prettify_node_recursive(const wcstring &source, const parse_node_tre /* Increment the indent if we are either a root job_list, or root case_item_list, or in an if or while header (#1665) */ const bool is_root_job_list = (node_type == symbol_job_list && parent_type != symbol_job_list); const bool is_root_case_item_list = (node_type == symbol_case_item_list && parent_type != symbol_case_item_list); - const bool is_if_while_header = (node_type == symbol_job && (parent_type == symbol_if_clause || parent_type == symbol_while_header)); + const bool is_if_while_header = ((node_type == symbol_job || node_type == symbol_andor_job_list) && + (parent_type == symbol_if_clause || parent_type == symbol_while_header)); if (is_root_job_list || is_root_case_item_list || is_if_while_header) { node_indent += 1; |