Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

fix: cannot read properties of undefined #124

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/plugin-split-editing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
"devDependencies": {
"@milkdown/core": "^7.4.0",
"@milkdown/prose": "^7.4.0",
"style-mod": "^4.1.0",
"tsup": "^8.2.4",
"typescript": "^5.5.4"
"typescript": "^5.5.4",
},
"dependencies": {
"@codemirror/commands": "^6.6.0",
Expand Down
11 changes: 8 additions & 3 deletions packages/plugin-split-editing/src/codemirror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
rectangularSelection,
} from '@codemirror/view'
import { $ctx } from '@milkdown/utils'
import { StyleModule } from 'style-mod'
import { Options } from '.'

const basicSetup: Extension = [
Expand Down Expand Up @@ -72,9 +73,13 @@ export class CodemirrorEditor {
extensions: [
basicSetup,
markdown(),
EditorView.styleModule.of({
getRules: () => '.cm-editor{height:100%}',
}),
EditorView.styleModule.of(
new StyleModule({
'.cm-editor': {
height: '100%',
},
}),
),
EditorView.lineWrapping,
updateListener,
...extensions,
Expand Down