From 03675e16588b811dcc417f10c591dcc2ac83b4c1 Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Wed, 20 Apr 2016 21:41:26 +0200 Subject: [PATCH] logic: Fixed declaration locations sometimes not visible --- src/lib/component/controller/CodeController.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/component/controller/CodeController.cpp b/src/lib/component/controller/CodeController.cpp index de284c38..18b97501 100644 --- a/src/lib/component/controller/CodeController.cpp +++ b/src/lib/component/controller/CodeController.cpp @@ -294,6 +294,7 @@ std::vector CodeController::getSnippetsForActiveTokenLocation const TokenLocationCollection* collection, Id declarationId ) const { std::vector snippets; + size_t declarationFileCount = 0; collection->forEachTokenLocationFile( [&](std::shared_ptr file) -> void @@ -309,7 +310,7 @@ std::vector CodeController::getSnippetsForActiveTokenLocation } ); - if (snippets.size() < 10 && (isDeclarationFile || collection->getTokenLocationFileCount() < 5 || file->isWholeCopy)) + if (declarationFileCount < 5 && (isDeclarationFile || collection->getTokenLocationFileCount() < 5 || file->isWholeCopy)) { std::vector fileSnippets = getSnippetsForActiveTokenLocationsInFile(file); @@ -330,6 +331,11 @@ std::vector CodeController::getSnippetsForActiveTokenLocation params.isCollapsed = true; snippets.push_back(params); } + + if (isDeclarationFile) + { + declarationFileCount++; + } } );