diff --git a/src/app/components/CodeEditor.tsx b/src/app/components/CodeEditor.tsx index 2368881..ad28d07 100644 --- a/src/app/components/CodeEditor.tsx +++ b/src/app/components/CodeEditor.tsx @@ -41,8 +41,9 @@ function prettify(text: string, mode: CodeMode): string { } export default function CodeEditor({ text, mode, readOnly = false, onSave }: CodeEditorProps) { - const [editMode, setEditMode] = useState(false); - const [saving, setSaving] = useState(false); + const [editMode, setEditMode] = useState(false); + const [editInitText, setEditInitText] = useState(''); + const [saving, setSaving] = useState(false); const editorViewRef = useRef(null); const displayText = prettify(text, mode); @@ -61,7 +62,7 @@ export default function CodeEditor({ text, mode, readOnly = false, onSave }: Cod {!readOnly && (
- {cursor < 0 && firstRenderRow === 0 && ( + {/* {cursor < 0 && firstRenderRow === 0 && (
Click a cell to position cursor{editMode ? ' · type hex digits or ASCII to edit' : ''}
- )} + )} */}
{Array.from({ length: lastRenderRow - firstRenderRow }, (_, i) => { diff --git a/src/app/components/MediaManager.tsx b/src/app/components/MediaManager.tsx index 2ddfe6d..b127c68 100644 --- a/src/app/components/MediaManager.tsx +++ b/src/app/components/MediaManager.tsx @@ -187,8 +187,9 @@ const CM_THEME = EditorView.theme({ }); function MarkdownEditor({ text, onSave }: { text: string; onSave?: (s: string) => Promise }) { - const [editMode, setEditMode] = useState(false); - const [saving, setSaving] = useState(false); + const [editMode, setEditMode] = useState(false); + const [editInitText, setEditInitText] = useState(''); + const [saving, setSaving] = useState(false); const editorViewRef = useRef(null); const save = async () => { @@ -203,7 +204,7 @@ function MarkdownEditor({ text, onSave }: { text: string; onSave?: (s: string) =
{onSave && (