From 594b460ba2d8dca59a3bfd282397c5f33aa9da6f Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 19 Dec 2015 14:45:45 -0800 Subject: 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 --- src/fish_indent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/fish_indent.cpp') 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; -- cgit v1.2.3