ui: code view scrolls directly to active line
This change makes the code view first look for the rect of the first active line and then tries to scroll this line into the middle of the view.
This commit is contained in:
@@ -155,12 +155,12 @@ void CodeController::handleMessage(MessageShowScope* message)
|
||||
return;
|
||||
}
|
||||
|
||||
getView()->addCodeSnippets(snippets);
|
||||
getView()->addCodeSnippets(snippets, true);
|
||||
}
|
||||
|
||||
void CodeController::handleMessage(MessageShowSnippets* message)
|
||||
{
|
||||
getView()->addCodeSnippets(getSnippetsForActiveTokenLocationsInFile(message->locationFile));
|
||||
getView()->addCodeSnippets(getSnippetsForActiveTokenLocationsInFile(message->locationFile), false);
|
||||
}
|
||||
|
||||
CodeView* CodeController::getView()
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
virtual void setErrorMessages(const std::vector<std::string>& errorMessages) = 0;
|
||||
|
||||
virtual void showCodeSnippets(const std::vector<CodeSnippetParams>& snippets) = 0;
|
||||
virtual void addCodeSnippets(const std::vector<CodeSnippetParams>& snippets) = 0;
|
||||
virtual void addCodeSnippets(const std::vector<CodeSnippetParams>& snippets, bool insert) = 0;
|
||||
virtual void showCodeFile(const CodeSnippetParams& params) = 0;
|
||||
|
||||
virtual void showFirstActiveSnippet() = 0;
|
||||
|
||||
Reference in New Issue
Block a user