Fix access to dead temporary

This commit is contained in:
Maxime Coste 2015-11-11 19:14:35 +00:00
parent b73a890f8c
commit d6168a90fc

View File

@ -48,11 +48,14 @@ Completions HighlighterGroup::complete_child(StringView path, ByteCount cursor_p
return offset_pos(hl.complete_child(path.substr(offset), cursor_pos - offset, group), offset); return offset_pos(hl.complete_child(path.substr(offset), cursor_pos - offset, group), offset);
} }
auto c = transformed(filtered(m_highlighters, auto candidates = complete(
path, cursor_pos,
transformed(filtered(m_highlighters,
[=](const HighlighterMap::Element& hl) [=](const HighlighterMap::Element& hl)
{ return not group or hl.value->has_children(); }), { return not group or hl.value->has_children(); }),
HighlighterMap::get_id); HighlighterMap::get_id));
return { 0, 0, complete(path, cursor_pos, c) };
return { 0, 0, std::move(candidates) };
} }
} }