Fixed #94.
This commit is contained in:
Martín Lucas Golini
2025-03-14 11:24:41 -03:00
parent d8aa670d12
commit c05dcd2c80
3 changed files with 10 additions and 9 deletions

View File

@@ -254,13 +254,14 @@ void AIAssistantPlugin::loadAIAssistantConfig( const std::string& path, bool upd
auto providerIt = mProviders.find( key );
if ( providerIt != mProviders.end() ) {
auto& provider = providerIt->second;
provider.apiUrl = value.apiUrl;
provider.name = value.name;
provider.displayName = value.displayName;
provider.enabled = value.enabled;
provider.fetchModelsUrl = value.fetchModelsUrl;
provider.openApi = value.openApi;
provider.models = value.models;
if ( !value.apiUrl.empty() )
provider.apiUrl = value.apiUrl;
if ( !value.name.empty() )
provider.name = value.name;
if ( value.displayName )
provider.displayName = value.displayName;
if ( value.fetchModelsUrl )
provider.fetchModelsUrl = value.fetchModelsUrl;
// Add model if not exists
for ( auto& model : value.models ) {
if ( std::find_if( provider.models.begin(), provider.models.end(),

View File

@@ -748,7 +748,7 @@ std::shared_ptr<FileListModel> UniversalLocator::openDocumentsModel( const std::
for ( size_t i = 0; i < names.size(); i++ ) {
int matchName = String::fuzzyMatch( pattern, names[i] );
int matchPath = String::fuzzyMatch( pattern, files[i] );
int matchScore = std::max( matchName, matchScore );
int matchScore = std::max( matchName, matchPath );
if ( matchScore > std::numeric_limits<int>::min() )
matchesMap.insert( { std::max( matchName, matchPath ), i } );
}