mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-16 09:06:33 +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
|
(widget) => widget.editor.uri.toString() === uri
|
||||||
);
|
);
|
||||||
if (!widget || forceOpen) {
|
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,
|
IDEUpdaterDialogWidget,
|
||||||
} from './dialogs/ide-updater/ide-updater-dialog';
|
} from './dialogs/ide-updater/ide-updater-dialog';
|
||||||
import { ElectronIpcConnectionProvider } from '@theia/core/lib/electron-browser/messaging/electron-ipc-connection-provider';
|
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');
|
const ElementQueries = require('css-element-queries/src/ElementQueries');
|
||||||
|
|
||||||
@ -508,6 +510,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|||||||
bind(SearchInWorkspaceWidget).toSelf();
|
bind(SearchInWorkspaceWidget).toSelf();
|
||||||
rebind(TheiaSearchInWorkspaceWidget).toService(SearchInWorkspaceWidget);
|
rebind(TheiaSearchInWorkspaceWidget).toService(SearchInWorkspaceWidget);
|
||||||
|
|
||||||
|
rebind(TheiaEditorManager).to(EditorManager);
|
||||||
|
|
||||||
// replace search icon
|
// replace search icon
|
||||||
rebind(TheiaSearchInWorkspaceFactory)
|
rebind(TheiaSearchInWorkspaceFactory)
|
||||||
.to(SearchInWorkspaceFactory)
|
.to(SearchInWorkspaceFactory)
|
||||||
|
@ -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