File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/vs/workbench/contrib/codeEditor/electron-browser Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6+ import { ThrottledDelayer } from '../../../../base/common/async.js' ;
67import { Disposable } from '../../../../base/common/lifecycle.js' ;
78import { FontMeasurements } from '../../../../editor/browser/config/fontMeasurements.js' ;
89import { INativeHostService } from '../../../../platform/native/common/native.js' ;
@@ -12,13 +13,18 @@ import { LifecyclePhase } from '../../../services/lifecycle/common/lifecycle.js'
1213
1314class DisplayChangeRemeasureFonts extends Disposable implements IWorkbenchContribution {
1415
16+ private readonly _delayer = this . _register ( new ThrottledDelayer ( 2000 ) ) ;
17+
1518 constructor (
1619 @INativeHostService nativeHostService : INativeHostService
1720 ) {
1821 super ( ) ;
1922
2023 this . _register ( nativeHostService . onDidChangeDisplay ( ( ) => {
21- FontMeasurements . clearAllFontInfos ( ) ;
24+ this . _delayer . trigger ( ( ) => {
25+ FontMeasurements . clearAllFontInfos ( ) ;
26+ return Promise . resolve ( ) ;
27+ } ) ;
2228 } ) ) ;
2329 }
2430}
You can’t perform that action at this time.
0 commit comments