1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-02 15:57:31 +00:00

[draft] txt viewer auto wrap

This commit is contained in:
Michael An 2025-05-13 17:50:44 +08:00
parent 1586ffd448
commit 5874054f2e

View File

@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import CodeMirror from '@uiw/react-codemirror';
import { EditorView } from '@codemirror/view';
import { getLanguageExtensions } from './languages';
import { myTheme } from './theme';
@ -25,7 +26,7 @@ class SeafileCodeMirror extends React.Component {
render() {
const { value, readOnly = true, fileExt } = this.props;
const extensions = [...getLanguageExtensions(fileExt).filter(item => item !== null)];
const extensions = [...getLanguageExtensions(fileExt).filter(item => item !== null), EditorView.lineWrapping];
return (
<div className='seafile-code-mirror-container'>
<CodeMirror