fix: clickhouse editor cursor sync issue (#5435)

This commit is contained in:
Vikrant Gupta 2024-07-08 19:27:02 +05:30 committed by GitHub
parent 4d64f1dede
commit 79eef5bb91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 15 deletions

View File

@ -141,11 +141,6 @@ function ImportJSON({
colors: { colors: {
'editor.background': Color.BG_INK_300, 'editor.background': Color.BG_INK_300,
}, },
fontFamily: 'Space Mono',
fontSize: 20,
fontWeight: 'normal',
lineHeight: 18,
letterSpacing: -0.06,
}); });
} }
@ -233,6 +228,11 @@ function ImportJSON({
fontFamily: 'Space Mono', fontFamily: 'Space Mono',
}} }}
theme={isDarkMode ? 'my-theme' : 'light'} theme={isDarkMode ? 'my-theme' : 'light'}
onMount={(_, monaco): void => {
document.fonts.ready.then(() => {
monaco.editor.remeasureFonts();
});
}}
// eslint-disable-next-line react/jsx-no-bind // eslint-disable-next-line react/jsx-no-bind
beforeMount={setEditorTheme} beforeMount={setEditorTheme}
/> />

View File

@ -53,7 +53,6 @@ function Overview({
enabled: false, enabled: false,
}, },
fontWeight: 400, fontWeight: 400,
// fontFamily: 'SF Mono',
fontFamily: 'Space Mono', fontFamily: 'Space Mono',
fontSize: 13, fontSize: 13,
lineHeight: '18px', lineHeight: '18px',
@ -80,12 +79,6 @@ function Overview({
colors: { colors: {
'editor.background': Color.BG_INK_400, 'editor.background': Color.BG_INK_400,
}, },
// fontFamily: 'SF Mono',
fontFamily: 'Space Mono',
fontSize: 12,
fontWeight: 'normal',
lineHeight: 18,
letterSpacing: -0.06,
}); });
} }
@ -124,6 +117,11 @@ function Overview({
onChange={(): void => {}} onChange={(): void => {}}
height="20vh" height="20vh"
theme={isDarkMode ? 'my-theme' : 'light'} theme={isDarkMode ? 'my-theme' : 'light'}
onMount={(_, monaco): void => {
document.fonts.ready.then(() => {
monaco.editor.remeasureFonts();
});
}}
// eslint-disable-next-line react/jsx-no-bind // eslint-disable-next-line react/jsx-no-bind
beforeMount={setEditorTheme} beforeMount={setEditorTheme}
/> />

View File

@ -87,9 +87,6 @@ function ClickHouseQueryBuilder({
'editor.background': Color.BG_INK_300, 'editor.background': Color.BG_INK_300,
}, },
}); });
document.fonts.ready.then(() => {
monaco.editor.remeasureFonts();
});
} }
return ( return (
@ -105,6 +102,11 @@ function ClickHouseQueryBuilder({
height="200px" height="200px"
onChange={handleUpdateEditor} onChange={handleUpdateEditor}
value={queryData.query} value={queryData.query}
onMount={(_, monaco): void => {
document.fonts.ready.then(() => {
monaco.editor.remeasureFonts();
});
}}
options={{ options={{
scrollbar: { scrollbar: {
alwaysConsumeMouseWheel: false, alwaysConsumeMouseWheel: false,