提交 fb4f36cc 编写于 作者: A Alex Dima

Redraw editors when vscode:osResume is received (#58167)

上级 7973e24a
......@@ -732,7 +732,7 @@ export interface ICodeEditor extends editorCommon.IEditor {
/**
* Force an editor render now.
*/
render(): void;
render(forceRedraw?: boolean): void;
/**
* Get the hit test target at coordinates `clientX` and `clientY`.
......
......@@ -1283,11 +1283,11 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
return this._modelData.view.getOffsetForColumn(lineNumber, column);
}
public render(): void {
public render(forceRedraw: boolean = false): void {
if (!this._modelData || !this._modelData.hasRealView) {
return;
}
this._modelData.view.render(true, false);
this._modelData.view.render(true, forceRedraw);
}
public applyFontInfo(target: HTMLElement): void {
......
......@@ -4042,7 +4042,7 @@ declare namespace monaco.editor {
/**
* Force an editor render now.
*/
render(): void;
render(forceRedraw?: boolean): void;
/**
* Get the hit test target at coordinates `clientX` and `clientY`.
* The coordinates are relative to the top-left of the viewport.
......
......@@ -8,6 +8,7 @@ import './electron-browser/accessibility';
import './electron-browser/inspectKeybindings';
import './electron-browser/largeFileOptimizations';
import './electron-browser/selectionClipboard';
import './electron-browser/sleepResumeRepaintMinimap';
import './electron-browser/textMate/inspectTMScopes';
import './electron-browser/toggleMinimap';
import './electron-browser/toggleMultiCursorModifier';
......
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { Registry } from 'vs/platform/registry/common/platform';
import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
import { ipcRenderer as ipc } from 'electron';
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
class SleepResumeRepaintMinimap implements IWorkbenchContribution {
constructor(
@ICodeEditorService codeEditorService: ICodeEditorService
) {
ipc.on('vscode:osResume', () => {
codeEditorService.listCodeEditors().forEach(editor => editor.render(true));
});
}
}
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(SleepResumeRepaintMinimap, LifecyclePhase.Eventually);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册