Skip to content

Commit

Permalink
Fix duplicated editor tabs (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
msujew authored and Alberto Iannaccone committed Jun 3, 2022
1 parent 750c534 commit 3f472f0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,11 @@ export class ArduinoFrontendContribution
(widget) => widget.editor.uri.toString() === uri
);
if (!widget || forceOpen) {
return this.editorManager.open(new URI(uri), options);
return this.editorManager.open(new URI(uri), options ?? {
mode: 'reveal',
preview: false,
counter: 0
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ import {
import { ElectronIpcConnectionProvider } from '@theia/core/lib/electron-browser/messaging/electron-ipc-connection-provider';
import { MonitorModel } from './monitor-model';
import { MonitorManagerProxyClientImpl } from './monitor-manager-proxy-client-impl';
import { EditorManager as TheiaEditorManager } from '@theia/editor/lib/browser/editor-manager';
import { EditorManager } from './theia/editor/editor-manager';

const ElementQueries = require('css-element-queries/src/ElementQueries');

Expand Down Expand Up @@ -525,6 +527,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
bind(SearchInWorkspaceWidget).toSelf();
rebind(TheiaSearchInWorkspaceWidget).toService(SearchInWorkspaceWidget);

rebind(TheiaEditorManager).to(EditorManager);

// replace search icon
rebind(TheiaSearchInWorkspaceFactory)
.to(SearchInWorkspaceFactory)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { EditorManager as TheiaEditorManager } from '@theia/editor/lib/browser/editor-manager';

export class EditorManager extends TheiaEditorManager {

protected getOrCreateCounterForUri(): number {
return 0;
}

}

0 comments on commit 3f472f0

Please # to comment.