Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Martín Lucas Golini
2026-04-24 19:36:38 -03:00
3 changed files with 14 additions and 7 deletions

View File

@@ -849,7 +849,7 @@ void UIDiffView::loadFromFile( const std::string& oldFilePath, const std::string
FileSystem::fileGet( oldFilePath, oldText );
FileSystem::fileGet( newFilePath, newText );
auto def = SyntaxDefinitionManager::instance()->getByExtension( oldFilePath );
auto def = SyntaxDefinitionManager::instance()->getByExtension( newFilePath );
mSyntaxDef =
SyntaxDefinitionManager::instance()->getLanguageDefinition( def.getLanguageIndex() );
mEditor->getDocument().setSyntaxDefinition( def );

View File

@@ -1104,10 +1104,17 @@ void GitPlugin::diff( const Git::DiffMode mode, const std::string& repoPath ) {
} );
}
void GitPlugin::diff( const std::string& file, bool isStaged ) {
mThreadPool->run( [this, file, isStaged] {
void GitPlugin::diff( const std::string& file, Git::GitStatusType status ) {
mThreadPool->run( [this, file, status] {
auto filePath = fixFilePath( file );
auto res = mGit->diff( filePath, isStaged, mGit->repoPath( file ) );
if ( status == Git::GitStatusType::Untracked ) {
getUISceneNode()->runOnMainThread( [this, filePath = std::move( filePath )] {
getPluginContext()->loadDiffFromPaths( "", filePath );
} );
return;
}
auto res =
mGit->diff( filePath, status == Git::GitStatusType::Staged, mGit->repoPath( file ) );
if ( res.fail() )
return;
@@ -1599,7 +1606,7 @@ void GitPlugin::buildSidePanelTab() {
break;
}
case ModelEventType::Open: {
diff( file->file, file->report.type == Git::GitStatusType::Staged );
diff( file->file, file->report.type );
break;
}
default:
@@ -1863,7 +1870,7 @@ void GitPlugin::openFileStatusMenu( const Git::DiffFile& file ) {
} else if ( id == "git-open-file" ) {
openFile( file.file );
} else if ( id == "git-diff" ) {
diff( file.file, file.report.type == Git::GitStatusType::Staged );
diff( file.file, file.report.type );
}
} );

View File

@@ -182,7 +182,7 @@ class GitPlugin : public PluginBase {
void diff( const Git::DiffMode mode, const std::string& repoPath );
void diff( const std::string& file, bool isStaged );
void diff( const std::string& file, Git::GitStatusType status );
void openFile( const std::string& file );