mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-31 10:36:30 +03:00
Fix bug in LSP Plugin when opening a same document in a split and then closing the original document, keybinds were lost after that.
This commit is contained in:
@@ -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<String::HashType>{} } );
|
||||
mEditorDocs[editor] = editor->getDocumentRef().get();
|
||||
|
||||
Reference in New Issue
Block a user