Skip to content

Commit

Permalink
Merge pull request #13 from BrianHung/master
Browse files Browse the repository at this point in the history
custom document layouts with y-prosemirror
  • Loading branch information
dmonad authored Mar 15, 2020
2 parents dcdd7d1 + 74182fb commit 112533e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/sync-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ export const ySyncPlugin = (yXmlFragment, { colors = defaultColors, colorMapping
update: () => {
const pluginState = plugin.getState(view.state)
if (pluginState.snapshot == null && pluginState.prevSnapshot == null) {
if (changedInitialContent || view.state.doc.content.size > 2) {
const emptySize = view.state.doc.type.createAndFill().content.size;
if (changedInitialContent || view.state.doc.content.size > emptySize) {
changedInitialContent = true
binding._prosemirrorChanged(view.state.doc)
}
Expand Down

0 comments on commit 112533e

Please sign in to comment.