aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--renderer/src/components/DocumentPane.tsx4
-rw-r--r--renderer/src/styles/globals.css8
2 files changed, 11 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%",
diff --git a/renderer/src/styles/globals.css b/renderer/src/styles/globals.css
index f115734..7ad199e 100644
--- a/renderer/src/styles/globals.css
+++ b/renderer/src/styles/globals.css
@@ -113,6 +113,8 @@ body {
113 display: flex; 113 display: flex;
114 flex-direction: column; 114 flex-direction: column;
115 border-right: 1px solid var(--border); 115 border-right: 1px solid var(--border);
116 min-width: 0;
117 overflow: hidden;
116} 118}
117 119
118.document-header { 120.document-header {
@@ -155,10 +157,16 @@ body {
155.codemirror-editor { 157.codemirror-editor {
156 flex: 1; 158 flex: 1;
157 overflow: hidden; 159 overflow: hidden;
160 min-height: 0;
158} 161}
159 162
160.codemirror-editor .cm-editor { 163.codemirror-editor .cm-editor {
161 height: 100%; 164 height: 100%;
165 max-width: 100%;
166}
167
168.codemirror-editor .cm-scroller {
169 overflow: auto !important;
162} 170}
163 171
164.codemirror-editor .cm-gutters { 172.codemirror-editor .cm-gutters {