mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-29 19:07:08 +00:00
Fix message_handler.cc when range is invalid
This commit is contained in:
parent
93ba0c532b
commit
45cb0b8cc5
@ -141,7 +141,8 @@ void EmitSemanticHighlighting(QueryDatabase* db,
|
|||||||
// shrinking hack, the contained keywords and primitive types will be
|
// shrinking hack, the contained keywords and primitive types will be
|
||||||
// highlighted undesiredly.
|
// highlighted undesiredly.
|
||||||
auto concise_name = detailed_name.substr(0, detailed_name.find('<'));
|
auto concise_name = detailed_name.substr(0, detailed_name.find('<'));
|
||||||
if (sym.loc.range.start.line <= working_file->index_lines.size()) {
|
if (0 < sym.loc.range.start.line &&
|
||||||
|
sym.loc.range.start.line <= working_file->index_lines.size()) {
|
||||||
const std::string& line =
|
const std::string& line =
|
||||||
working_file->index_lines[sym.loc.range.start.line - 1];
|
working_file->index_lines[sym.loc.range.start.line - 1];
|
||||||
sym.loc.range.end.line = sym.loc.range.start.line;
|
sym.loc.range.end.line = sym.loc.range.start.line;
|
||||||
|
Loading…
Reference in New Issue
Block a user