Skip to content

Commit 8bd4473

Browse files
committed
Fix padding issue
1 parent 1784b82 commit 8bd4473

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/browser/modules/Editor/Monaco.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ const Monaco = forwardRef<MonacoHandles, MonacoProps>(
127127
const cursorPosition = editorRef?.current?.getPosition() as IPosition
128128
editorRef.current?.setValue(editorRef.current?.getValue() || '')
129129
editorRef.current?.setPosition(cursorPosition)
130-
131-
updateGutterCharWidth(useDb || '')
132130
}, [useDb])
133131

134132
// Create monaco instance, listen to text changes and destroy
@@ -246,7 +244,7 @@ const Monaco = forwardRef<MonacoHandles, MonacoProps>(
246244
useEffect(() => {
247245
onContentUpdate()
248246
// eslint-disable-next-line react-hooks/exhaustive-deps
249-
}, [enableMultiStatementMode])
247+
}, [enableMultiStatementMode, useDb])
250248

251249
useEffect(() => {
252250
editorRef.current?.updateOptions({ fontLigatures })
@@ -361,7 +359,7 @@ const Monaco = forwardRef<MonacoHandles, MonacoProps>(
361359
const updateGutterCharWidth = (dbName: string) => {
362360
editorRef.current?.updateOptions({
363361
lineNumbersMinChars:
364-
dbName.length && !isMultiLine() ? dbName.length * 1.2 : 2
362+
dbName.length && !isMultiLine() ? dbName.length * 1.3 : 2
365363
})
366364
}
367365

@@ -373,7 +371,7 @@ const Monaco = forwardRef<MonacoHandles, MonacoProps>(
373371
[]
374372
)
375373

376-
updateGutterCharWidth(useDbRef.current || '')
374+
updateGutterCharWidth(useDb || '')
377375
debouncedUpdateCode()
378376
}
379377

0 commit comments

Comments
 (0)