From 513ea022dd363cf320c3c1a6e71d395e34ccc193 Mon Sep 17 00:00:00 2001 From: Jens Haase Date: Fri, 12 Jul 2024 21:17:23 +0200 Subject: [PATCH] Run CmdPeriod.run() inside the LSPConnection handler thread. ServerTree.add or CmdPeriod.add hooks can update the surounding environment. Therefore CmdPeriod.run() has to be executed in the LSPConnection handler thread which defines it's own environment. --- Providers/ExecuteCommandProvider.sc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Providers/ExecuteCommandProvider.sc b/Providers/ExecuteCommandProvider.sc index 1ab20b4..24401d0 100644 --- a/Providers/ExecuteCommandProvider.sc +++ b/Providers/ExecuteCommandProvider.sc @@ -60,7 +60,9 @@ ExecuteCommandProvider : LSPProvider { Server.default.stopRecording() }, 'supercollider.internal.cmdPeriod': { - CmdPeriod.run(); + LSPConnection.handlerThread.next({ + CmdPeriod.run(); + }) } ) }