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

@@ -40,6 +40,12 @@ export default function Editor({
pref => pref >= 10 && pref <= 22
);
const [wordWrap, setWordWrap] = usePreference<boolean>(
'wordwrap',
true,
() => true
);
useEffect(() => {
if (contentType) {
setLanguage(contentType);
@@ -66,6 +72,8 @@ export default function Editor({
setReadOnly={setReadOnly}
theme={theme}
setTheme={setTheme}
wordWrap={wordWrap}
setWordWrap={setWordWrap}
zoom={zoom}
/>
<EditorTextArea
@@ -76,6 +84,7 @@ export default function Editor({
language={language}
fontSize={fontSize}
readOnly={readOnly}
wordWrap={wordWrap}
resetFunction={resetFunction}
/>
</ThemeProvider>