mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-30 01:56:31 +03:00
Fix range detection in universal locator.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "universallocator.hpp"
|
||||
#include "ecode.hpp"
|
||||
#include "pathhelper.hpp"
|
||||
#include "settingsmenu.hpp"
|
||||
#include "universallocator.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -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" );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user