Skip to content

Commit 5fc30bd

Browse files
authored
Fix duplicated editor tabs (#1012)
1 parent 522a5c6 commit 5fc30bd

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

Diff for: arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,11 @@ export class ArduinoFrontendContribution
575575
(widget) => widget.editor.uri.toString() === uri
576576
);
577577
if (!widget || forceOpen) {
578-
return this.editorManager.open(new URI(uri), options);
578+
return this.editorManager.open(new URI(uri), options ?? {
579+
mode: 'reveal',
580+
preview: false,
581+
counter: 0
582+
});
579583
}
580584
}
581585

Diff for: arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts

+4
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ import {
275275
IDEUpdaterDialogWidget,
276276
} from './dialogs/ide-updater/ide-updater-dialog';
277277
import { ElectronIpcConnectionProvider } from '@theia/core/lib/electron-browser/messaging/electron-ipc-connection-provider';
278+
import { EditorManager as TheiaEditorManager } from '@theia/editor/lib/browser/editor-manager';
279+
import { EditorManager } from './theia/editor/editor-manager';
278280

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

@@ -507,6 +509,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
507509

508510
bind(SearchInWorkspaceWidget).toSelf();
509511
rebind(TheiaSearchInWorkspaceWidget).toService(SearchInWorkspaceWidget);
512+
513+
rebind(TheiaEditorManager).to(EditorManager);
510514

511515
// replace search icon
512516
rebind(TheiaSearchInWorkspaceFactory)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { EditorManager as TheiaEditorManager } from '@theia/editor/lib/browser/editor-manager';
2+
3+
export class EditorManager extends TheiaEditorManager {
4+
5+
protected getOrCreateCounterForUri(): number {
6+
return 0;
7+
}
8+
9+
}

0 commit comments

Comments
 (0)