diff --git a/src/tools/ecode/universallocator.cpp b/src/tools/ecode/universallocator.cpp index 6df50d175..2d90f5a33 100644 --- a/src/tools/ecode/universallocator.cpp +++ b/src/tools/ecode/universallocator.cpp @@ -1,7 +1,7 @@ +#include "universallocator.hpp" #include "ecode.hpp" #include "pathhelper.hpp" #include "settingsmenu.hpp" -#include "universallocator.hpp" #include @@ -553,6 +553,10 @@ void UniversalLocator::initLocateBar( UILocateBar* locateBar, UITextInput* locat ModelRole::Custom ) ); auto range = rangeStr.isValid() ? TextRange::fromString( rangeStr.toString() ) : TextRange(); + + if ( FileSystem::isRelativePath( path ) ) + path = mApp->getCurrentProject() + path; + if ( !range.isValid() && !FileSystem::isRelativePath( path ) && pathHasPosition( mLocateInput->getText() ) && String::startsWith( mLocateInput->getText().toUtf8(), path ) ) { @@ -560,9 +564,6 @@ void UniversalLocator::initLocateBar( UILocateBar* locateBar, UITextInput* locat range = { pathAndPos.second, pathAndPos.second }; } - if ( FileSystem::isRelativePath( path ) ) - path = mApp->getCurrentProject() + path; - focusOrLoadFile( path, range ); mLocateBarLayout->execute( "close-locatebar" ); }