Syntax highlighting now correctly handles cd

This commit is contained in:
ridiculousfish
2013-10-07 03:56:09 -07:00
parent 20ccda69f4
commit 4f718e83b3
4 changed files with 103 additions and 24 deletions

View File

@@ -936,3 +936,17 @@ parse_node_tree_t::parse_node_list_t parse_node_tree_t::find_nodes(const parse_n
find_nodes_recursive(*this, parent, type, &result);
return result;
}
bool parse_node_tree_t::argument_list_is_root(const parse_node_t &node) const
{
bool result = true;
assert(node.type == symbol_argument_list || node.type == symbol_arguments_or_redirections_list);
const parse_node_t *parent = this->get_parent(node);
if (parent != NULL)
{
/* We have a parent - check to make sure it's not another list! */
result = parent->type != symbol_arguments_or_redirections_list && parent->type != symbol_argument_list;
}
return result;
}