mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-14 16:16:32 +00:00
Fix duplicated editor tabs (#1012)
This commit is contained in:
parent
522a5c6e01
commit
5fc30bd33e
@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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');
|
||||
|
||||
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user