logic: scroll code when no symbol
Scrolling to line, when comming from plugin and the file is was modified. Since there we dont know from the position data if the symbol on position is the right one, we scroll to the line if modified.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "utility/messaging/type/MessageStatus.h"
|
||||
#include "utility/messaging/type/MessageScrollToLine.h"
|
||||
#include "utility/text/TextAccess.h"
|
||||
#include "utility/tracing.h"
|
||||
#include "utility/utility.h"
|
||||
@@ -234,6 +235,26 @@ void CodeController::handleMessage(MessageFocusOut* message)
|
||||
getView()->defocusTokenIds();
|
||||
}
|
||||
|
||||
void CodeController::handleMessage(MessageScrollToLine* message)
|
||||
{
|
||||
getView()->scrollToLine(message->filename, message->line);
|
||||
|
||||
if ( message->isModified )
|
||||
{
|
||||
MessageStatus(
|
||||
"File was modified. Showing the File: " + message->filename
|
||||
+ " at line " + std::to_string(message->line) + " now. Please refresh."
|
||||
).dispatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageStatus(
|
||||
"Showing the File: " + message->filename
|
||||
+ " at line " + std::to_string(message->line) + "."
|
||||
).dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
void CodeController::handleMessage(MessageScrollCode* message)
|
||||
{
|
||||
if (message->isReplayed())
|
||||
|
||||
Reference in New Issue
Block a user