Skip to content

Commit

Permalink
Fix padding issue
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarDamkjaer committed Jan 29, 2021
1 parent 1784b82 commit 8bd4473
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/browser/modules/Editor/Monaco.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ const Monaco = forwardRef<MonacoHandles, MonacoProps>(
const cursorPosition = editorRef?.current?.getPosition() as IPosition
editorRef.current?.setValue(editorRef.current?.getValue() || '')
editorRef.current?.setPosition(cursorPosition)

updateGutterCharWidth(useDb || '')
}, [useDb])

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

useEffect(() => {
editorRef.current?.updateOptions({ fontLigatures })
Expand Down Expand Up @@ -361,7 +359,7 @@ const Monaco = forwardRef<MonacoHandles, MonacoProps>(
const updateGutterCharWidth = (dbName: string) => {
editorRef.current?.updateOptions({
lineNumbersMinChars:
dbName.length && !isMultiLine() ? dbName.length * 1.2 : 2
dbName.length && !isMultiLine() ? dbName.length * 1.3 : 2
})
}

Expand All @@ -373,7 +371,7 @@ const Monaco = forwardRef<MonacoHandles, MonacoProps>(
[]
)

updateGutterCharWidth(useDbRef.current || '')
updateGutterCharWidth(useDb || '')
debouncedUpdateCode()
}

Expand Down

0 comments on commit 8bd4473

Please sign in to comment.