logic: Fixed code not annotated for full file in snippet mode

* show focused line marker when stepping through code references
This commit is contained in:
Eberhard Graether
2017-10-03 08:09:57 +02:00
parent a72da67d32
commit fdea8113a0
2 changed files with 11 additions and 2 deletions
@@ -424,8 +424,10 @@ void CodeController::expandVisibleSnippets(std::vector<CodeSnippetParams>* snipp
continue;
}
CodeView::FileState fileState = oldSnippet.locationFile->isWhole() ? CodeView::FILE_MAXIMIZED : state;
std::vector<CodeSnippetParams> newSnippets =
getSnippetsForFileWithState(oldSnippet.locationFile->getFilePath(), state, addSourceLocations);
getSnippetsForFileWithState(oldSnippet.locationFile->getFilePath(), fileState, addSourceLocations);
if (!newSnippets.size())
{
continue;
+8 -1
View File
@@ -149,6 +149,7 @@ void QtCodeArea::lineNumberAreaPaintEvent(QPaintEvent *event)
std::set<int> focusedLineNumbers;
std::set<Id> activeSymbolIds = m_navigator->getActiveTokenIds();
std::set<Id> activeLocationIds = m_navigator->getCurrentActiveLocationIds();
for (const Annotation& annotation : m_annotations)
{
@@ -178,9 +179,15 @@ void QtCodeArea::lineNumberAreaPaintEvent(QPaintEvent *event)
case LOCATION_TOKEN:
case LOCATION_SCOPE:
if (annotation.isFocused && utility::shareElement(activeSymbolIds, annotation.tokenIds))
if (annotation.isActive && activeLocationIds.size())
{
focus = true;
break;
}
else if (annotation.isFocused && utility::shareElement(activeSymbolIds, annotation.tokenIds))
{
active = true;
break;
}
default: