We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents efd614b + a66d813 commit 08c5f86Copy full SHA for 08c5f86
ui/frontend/editor/MonacoEditorCore.tsx
@@ -8,6 +8,14 @@ import { themeVsDarkPlus } from './rust_monaco_def';
8
9
import * as styles from './Editor.module.css';
10
11
+async function remeasureFontWhenReady(fonts: FontFaceSet, font: string) {
12
+ while (!fonts.check(font)) {
13
+ await fonts.ready;
14
+ }
15
+
16
+ monaco.editor.remeasureFonts();
17
+}
18
19
function useEditorProp<T>(
20
editor: monaco.editor.IStandaloneCodeEditor | null,
21
prop: T,
@@ -68,6 +76,8 @@ const MonacoEditorCore: React.FC<CommonEditorProps> = (props) => {
68
76
});
69
77
setEditor(editor);
70
78
79
+ remeasureFontWhenReady(document.fonts, nodeStyle.font);
80
71
81
editor.focus();
72
82
}, []);
73
83
0 commit comments