summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-11-11 19:14:35 +0000
committerMaxime Coste <frrrwww@gmail.com>2015-11-11 19:14:35 +0000
commitd6168a90fc86ff6dc899ca83c35b84224cdd081a (patch)
tree49243f9f0b47d7f0af6f9e140212c562e4891268 /src
parentb73a890f8c04c553b45a8e5c3a85fe6ff786346e (diff)
Fix access to dead temporary
Diffstat (limited to 'src')
-rw-r--r--src/highlighter_group.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/highlighter_group.cc b/src/highlighter_group.cc
index 4a513bac..7e76264a 100644
--- a/src/highlighter_group.cc
+++ b/src/highlighter_group.cc
@@ -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);
}
- auto c = transformed(filtered(m_highlighters,
- [=](const HighlighterMap::Element& hl)
- { return not group or hl.value->has_children(); }),
- HighlighterMap::get_id);
- return { 0, 0, complete(path, cursor_pos, c) };
+ auto candidates = complete(
+ path, cursor_pos,
+ transformed(filtered(m_highlighters,
+ [=](const HighlighterMap::Element& hl)
+ { return not group or hl.value->has_children(); }),
+ HighlighterMap::get_id));
+
+ return { 0, 0, std::move(candidates) };
}
}