diff --git a/src/tools/ecode/plugins/git/gitplugin.hpp b/src/tools/ecode/plugins/git/gitplugin.hpp index 446fddeb7..736a9c7e8 100644 --- a/src/tools/ecode/plugins/git/gitplugin.hpp +++ b/src/tools/ecode/plugins/git/gitplugin.hpp @@ -36,7 +36,7 @@ static constexpr const char* GIT_STASH = "git-stash"; class GitPlugin : public PluginBase { public: static PluginDefinition Definition() { - return { "git", "Git", "Git integration", GitPlugin::New, { 0, 0, 1 }, GitPlugin::NewSync }; + return { "git", "Git", "Git integration", GitPlugin::New, { 0, 1, 0 }, GitPlugin::NewSync }; } static Plugin* New( PluginManager* pluginManager ); diff --git a/src/tools/ecode/plugins/lsp/lspclientplugin.cpp b/src/tools/ecode/plugins/lsp/lspclientplugin.cpp index 463340720..1fd66b0e2 100644 --- a/src/tools/ecode/plugins/lsp/lspclientplugin.cpp +++ b/src/tools/ecode/plugins/lsp/lspclientplugin.cpp @@ -1236,6 +1236,7 @@ void LSPClientPlugin::onRegister( UICodeEditor* editor ) { listeners.push_back( editor->addEventListener( Event::OnDocumentLoaded, [this, editor]( const Event* ) { + mEditorDocs[editor] = editor->getDocumentRef().get(); mClientManager.run( editor->getDocumentRef() ); } ) ); @@ -1245,6 +1246,15 @@ void LSPClientPlugin::onRegister( UICodeEditor* editor ) { hideTooltip( editor ); } ) ); + listeners.push_back( + editor->addEventListener( Event::OnDocumentChanged, [this, editor]( const Event* ) { + TextDocument* oldDoc = mEditorDocs[editor]; + TextDocument* newDoc = editor->getDocumentRef().get(); + Lock l( mDocMutex ); + mDocs.erase( oldDoc ); + mEditorDocs[editor] = newDoc; + } ) ); + mEditors.insert( { editor, listeners } ); mEditorsTags.insert( { editor, UnorderedSet{} } ); mEditorDocs[editor] = editor->getDocumentRef().get(); diff --git a/src/tools/ecode/plugins/lsp/lspclientplugin.hpp b/src/tools/ecode/plugins/lsp/lspclientplugin.hpp index bf80a8d7e..5bc89da62 100644 --- a/src/tools/ecode/plugins/lsp/lspclientplugin.hpp +++ b/src/tools/ecode/plugins/lsp/lspclientplugin.hpp @@ -25,7 +25,7 @@ class LSPClientPlugin : public Plugin { public: static PluginDefinition Definition() { return { "lspclient", "LSP Client", "Language Server Protocol Client.", - LSPClientPlugin::New, { 0, 2, 3 }, LSPClientPlugin::NewSync }; + LSPClientPlugin::New, { 0, 2, 4 }, LSPClientPlugin::NewSync }; } static Plugin* New( PluginManager* pluginManager );