Skip to content

Commit

Permalink
fix: rewrite content width (#4103)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricbet authored Oct 18, 2024
1 parent eb63446 commit f112878
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ const TextBoxProvider = React.memo((props: ITextBoxProviderProps) => {

const lineCount = currentLineNumber - range.startLineNumber;
const spaceWidth = virtualEditor!.getOption(monaco.editor.EditorOption.fontInfo).spaceWidth;
const contentLeft = virtualEditor!.getOption(monaco.editor.EditorOption.layoutInfo).contentLeft;
let maxColumnWidth = 0;
const tabSize = virtualModel.getOptions().tabSize;
Array.from(
Expand All @@ -149,7 +150,7 @@ const TextBoxProvider = React.memo((props: ITextBoxProviderProps) => {
}
});

setEditorSize({ width: maxColumnWidth * spaceWidth, height: lineHeight * (lineCount + 1) });
setEditorSize({ width: maxColumnWidth * spaceWidth + contentLeft * 2, height: lineHeight * (lineCount + 1) });
},
[editorSize, editor],
);
Expand Down

0 comments on commit f112878

Please sign in to comment.