Skip to content

Commit

Permalink
Console history mix In 2024.2 #104
Browse files Browse the repository at this point in the history
  • Loading branch information
smklimenko committed Sep 23, 2024
1 parent 45620b3 commit 3f6e41a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pluginVersion=5.10.0
pluginVersion=5.10.1

0 comments on commit 3f6e41a

Please sign in to comment.