Skip to content

Commit

Permalink
fix cm->pm change forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuebert committed Aug 3, 2023
1 parent 35954b6 commit 385b2f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions editor2/src/main/maria/editor/code/NodeView.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

(js
(defn code:forward-update
"When the code-editor is focused, forward events from it to ProseMirror."
"Forward events from CodeMirror to ProseMirror (shen the code-editor is focused)"
[{:keys [CodeView ProseView getPos code-updating?]} code-update]
(let [{prose-state :state} ProseView
focus-changed? (.-focusChanged code-update)
Expand All @@ -80,7 +80,9 @@
{code-changed? :docChanged
code-changes :changes} code-update
{:keys [tr doc]} prose-state
selection-changed? (not (.eq (.. prose-state -selection)
selection-changed? (not (.eq (.. code-update -startState -selection)
(.. code-update -state -selection)))
#_(not (.eq (.. prose-state -selection)
(.create TextSelection
doc
(+ start-pos from')
Expand Down

0 comments on commit 385b2f4

Please # to comment.