diff --git a/CHANGELOG.md b/CHANGELOG.md index 266f442..aff07d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # KdbInsideBrains Changelog +## [5.10.1] + +### Fixed + +- Issue #104: In 2024.2, instances do not split console history + ## [5.10.0] ### Changed diff --git a/src/main/java/org/kdb/inside/brains/view/console/KdbConsolePanel.java b/src/main/java/org/kdb/inside/brains/view/console/KdbConsolePanel.java index 6f17780..eb6a1a6 100644 --- a/src/main/java/org/kdb/inside/brains/view/console/KdbConsolePanel.java +++ b/src/main/java/org/kdb/inside/brains/view/console/KdbConsolePanel.java @@ -1,7 +1,6 @@ package org.kdb.inside.brains.view.console; import com.intellij.execution.actions.ClearConsoleAction; -import com.intellij.execution.console.BaseConsoleExecuteActionHandler; import com.intellij.execution.console.GutterContentProvider; import com.intellij.execution.console.LanguageConsoleBuilder; import com.intellij.execution.console.LanguageConsoleView; @@ -173,24 +172,25 @@ private JBSplitter createWatchesSplitter() { } private TabInfo createConsoleTab() { - final LanguageConsoleBuilder b = new LanguageConsoleBuilder(); - b.executionEnabled(view -> connection != null && connection.isConnected()); - - b.initActions(new BaseConsoleExecuteActionHandler(true) { - @Override - protected void execute(@NotNull String text, @NotNull LanguageConsoleView console) { - if (!showHistory) { - clearHistory(); - gutterProvider.beforeEvaluate(console.getHistoryViewer()); - } - processQuery(new KdbQuery(text)); - } - }, "KdbConsolePanel-" + connection.getName()); + final String historyName = "KdbConsolePanel-" + connection.getName(); + final LanguageConsoleBuilder b = new LanguageConsoleBuilder(); b.gutterContentProvider(gutterProvider); - console = b.build(project, QLanguage.INSTANCE); + LanguageConsoleBuilder.registerExecuteAction(console, + text -> { + if (!showHistory) { + clearHistory(); + gutterProvider.beforeEvaluate(console.getHistoryViewer()); + } + processQuery(new KdbQuery(text)); + }, + historyName, + historyName, + view -> connection.isConnected() + ); + printToConsole("Kdb console for instance: " + connection.getName() + ".\n", ConsoleViewContentType.SYSTEM_OUTPUT); watchesSplitter.setFirstComponent(console.getComponent()); @@ -597,8 +597,7 @@ public void dispose() { if (scope != null) { scope.removeScopeListener(scopeListener); } -// Disposer.dispose(console); -// Disposer.dispose(resultTabs); + Disposer.dispose(console); } private void printInstanceError(Exception ex) { diff --git a/version.properties b/version.properties index 9381630..8793367 100644 --- a/version.properties +++ b/version.properties @@ -1 +1 @@ -pluginVersion=5.10.0 \ No newline at end of file +pluginVersion=5.10.1 \ No newline at end of file