aboutsummaryrefslogtreecommitdiffstats
path: root/renderer/src/components/DocumentPane.tsx
diff options
context:
space:
mode:
authorClawd <ai@clawd.bot>2026-02-28 14:47:43 -0800
committerClawd <ai@clawd.bot>2026-02-28 14:47:43 -0800
commit4bd42f9c508345391806eb7c5c2ed39863764695 (patch)
treec1409c8deb8bc09ce198c521290c6f53fc17b0f2 /renderer/src/components/DocumentPane.tsx
parent812702aa9afbfe8de7672520852a6066341a4dc0 (diff)
Fix CodeMirror line wrapping and container overflow
- Add EditorView.lineWrapping for soft word wrap - Fix container CSS to prevent horizontal overflow - Add min-width: 0 to document-pane for proper flex shrinking - Add overflow: hidden to contain the editor
Diffstat (limited to 'renderer/src/components/DocumentPane.tsx')
-rw-r--r--renderer/src/components/DocumentPane.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/renderer/src/components/DocumentPane.tsx b/renderer/src/components/DocumentPane.tsx
index cf777b1..c5f456c 100644
--- a/renderer/src/components/DocumentPane.tsx
+++ b/renderer/src/components/DocumentPane.tsx
@@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect } from "react";
2import ReactMarkdown from "react-markdown"; 2import ReactMarkdown from "react-markdown";
3import remarkGfm from "remark-gfm"; 3import remarkGfm from "remark-gfm";
4import { EditorState } from "@codemirror/state"; 4import { EditorState } from "@codemirror/state";
5import { EditorView, keymap, lineNumbers, highlightActiveLine } from "@codemirror/view"; 5import { EditorView, keymap, lineNumbers, highlightActiveLine, drawSelection } from "@codemirror/view";
6import { markdown } from "@codemirror/lang-markdown"; 6import { markdown } from "@codemirror/lang-markdown";
7import { languages } from "@codemirror/language-data"; 7import { languages } from "@codemirror/language-data";
8import { defaultKeymap, history, historyKeymap } from "@codemirror/commands"; 8import { defaultKeymap, history, historyKeymap } from "@codemirror/commands";
@@ -43,12 +43,14 @@ function MarkdownEditor({
43 extensions: [ 43 extensions: [
44 lineNumbers(), 44 lineNumbers(),
45 highlightActiveLine(), 45 highlightActiveLine(),
46 drawSelection(),
46 history(), 47 history(),
47 keymap.of([...defaultKeymap, ...historyKeymap]), 48 keymap.of([...defaultKeymap, ...historyKeymap]),
48 markdown({ codeLanguages: languages }), 49 markdown({ codeLanguages: languages }),
49 oneDark, 50 oneDark,
50 updateListener, 51 updateListener,
51 EditorView.editable.of(!disabled), 52 EditorView.editable.of(!disabled),
53 EditorView.lineWrapping,
52 EditorView.theme({ 54 EditorView.theme({
53 "&": { 55 "&": {
54 height: "100%", 56 height: "100%",