ecode: Fix for textDocument/rename not loading un-opened files correctly (they were opening without plugins). Fixed Open Documents listing in Universal Locator.

This commit is contained in:
Martín Lucas Golini
2023-06-22 01:50:48 -03:00
parent 4120a25a24
commit 5ab1fa72d3
5 changed files with 62 additions and 26 deletions
+11 -2
View File
@@ -443,7 +443,16 @@ void App::onPluginEnabled( UICodeEditorPlugin* plugin ) {
}
void App::initPluginManager() {
mPluginManager = std::make_unique<PluginManager>( mResPath, mPluginsPath, mThreadPool );
mPluginManager = std::make_unique<PluginManager>(
mResPath, mPluginsPath, mThreadPool, [this]( const std::string& path, const auto& cb ) {
UITab* tab = mSplitter->isDocumentOpen( path );
if ( !tab ) {
loadFileFromPath( path, true, nullptr, cb );
} else {
tab->getTabWidget()->setTabSelected( tab );
cb( tab->getOwnedWidget()->asType<UICodeEditor>(), path );
}
} );
mPluginManager->onPluginEnabled = [&]( UICodeEditorPlugin* plugin ) {
if ( nullptr == mUISceneNode || plugin->isReady() ) {
onPluginEnabled( plugin );
@@ -1226,7 +1235,7 @@ void App::loadFileFromPathOrFocus( const std::string& path ) {
}
void App::createPluginManagerUI() {
UIPluginManager::New( mUISceneNode, mPluginManager.get(), [&]( const std::string& path ) {
UIPluginManager::New( mUISceneNode, mPluginManager.get(), [this]( const std::string& path ) {
loadFileFromPathOrFocus( path );
} )->showWhenReady();
}