Skip to content

Commit 3f472f0

Browse files
msujewAlberto Iannaccone
authored and
Alberto Iannaccone
committed
Fix duplicated editor tabs (#1012)
1 parent 750c534 commit 3f472f0

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
@@ -579,7 +579,11 @@ export class ArduinoFrontendContribution
579579
(widget) => widget.editor.uri.toString() === uri
580580
);
581581
if (!widget || forceOpen) {
582-
return this.editorManager.open(new URI(uri), options);
582+
return this.editorManager.open(new URI(uri), options ?? {
583+
mode: 'reveal',
584+
preview: false,
585+
counter: 0
586+
});
583587
}
584588
}
585589

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

+4
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ import {
276276
import { ElectronIpcConnectionProvider } from '@theia/core/lib/electron-browser/messaging/electron-ipc-connection-provider';
277277
import { MonitorModel } from './monitor-model';
278278
import { MonitorManagerProxyClientImpl } from './monitor-manager-proxy-client-impl';
279+
import { EditorManager as TheiaEditorManager } from '@theia/editor/lib/browser/editor-manager';
280+
import { EditorManager } from './theia/editor/editor-manager';
279281

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

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

530+
rebind(TheiaEditorManager).to(EditorManager);
531+
528532
// replace search icon
529533
rebind(TheiaSearchInWorkspaceFactory)
530534
.to(SearchInWorkspaceFactory)
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)