Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicated editor tabs #1012

Merged
merged 1 commit into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,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 @@ -275,6 +275,8 @@ import {
IDEUpdaterDialogWidget,
} from './dialogs/ide-updater/ide-updater-dialog';
import { ElectronIpcConnectionProvider } from '@theia/core/lib/electron-browser/messaging/electron-ipc-connection-provider';
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 @@ -507,6 +509,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)
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;
}

}