Add option to wrap text (#20)

This commit is contained in:
Isaac - The456
2025-03-15 13:36:29 +00:00
committed by GitHub
parent 0d7cd64eef
commit 24025642f4
5 changed files with 58 additions and 9 deletions

View File

@@ -62,6 +62,7 @@ export interface EditorTextAreaProps {
language: string;
fontSize: number;
readOnly: boolean;
wordWrap: boolean;
resetFunction: MutableRefObject<ResetFunction | null>;
}
@@ -73,6 +74,7 @@ export default function EditorTextArea({
language,
fontSize,
readOnly,
wordWrap,
resetFunction,
}: EditorTextAreaProps) {
const [editor, setEditor] = useState<editor.IStandaloneCodeEditor>();
@@ -166,7 +168,7 @@ export default function EditorTextArea({
fontFamily: 'JetBrains Mono',
fontSize: fontSize,
fontLigatures: true,
wordWrap: 'on',
wordWrap: wordWrap ? 'on' : 'off',
renderLineHighlight: 'none',
renderValidationDecorations: 'off',
readOnly,