mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-25 09:05:10 +00:00
Fix crash when dynamically adding completion item
This commit is contained in:
parent
259d30ef8a
commit
0b1cc52c58
@ -139,8 +139,9 @@ void IncludeComplete::InsertCompletionItem(const std::string& absolute_path,
|
||||
// insert if not found or with shorter include path
|
||||
auto it = absolute_path_to_completion_item.find(absolute_path);
|
||||
if (it == absolute_path_to_completion_item.end() ||
|
||||
completion_items[it->second].detail.length() > item.detail.length())
|
||||
absolute_path_to_completion_item[absolute_path] = completion_items.size();
|
||||
completion_items[it->second].detail.length() > item.detail.length()) {
|
||||
absolute_path_to_completion_item[absolute_path] = completion_items.size() - 1;
|
||||
}
|
||||
} else {
|
||||
lsCompletionItem& inserted_item =
|
||||
completion_items[inserted_paths[item.detail]];
|
||||
|
Loading…
Reference in New Issue
Block a user