Fix in LSP Client, incorrectly unbinding commands from document.
Emscripten improvements (clipboard).
This commit is contained in:
Martín Lucas Golini
2023-07-03 12:31:51 -03:00
parent 1f1f2b5c17
commit 6871fd3b65
9 changed files with 313 additions and 19 deletions

View File

@@ -1183,14 +1183,12 @@ void LSPClientPlugin::getSymbolInfo( UICodeEditor* editor ) {
}
void LSPClientPlugin::onUnregister( UICodeEditor* editor ) {
for ( auto& kb : mKeyBindings ) {
for ( auto& kb : mKeyBindings )
editor->getKeyBindings().removeCommandKeybind( kb.first );
if ( editor->hasDocument() )
editor->getDocument().removeCommand( kb.first );
}
if ( mShuttingDown )
return;
Lock l( mDocMutex );
TextDocument* doc = &editor->getDocument();
const auto& cbs = mEditors[editor];
@@ -1204,6 +1202,11 @@ void LSPClientPlugin::onUnregister( UICodeEditor* editor ) {
return;
}
if ( editor->hasDocument() ) {
for ( auto& kb : mKeyBindings )
editor->getDocument().removeCommand( kb.first );
}
{
Lock lds( mDocSymbolsMutex );
mDocSymbols.erase( doc->getURI() );