1
0
Эх сурвалжийг харах

fix: another left conflict issue when insert-nodes

rcmerci 4 жил өмнө
parent
commit
454d301cc3

+ 2 - 1
src/main/frontend/format/block.cljs

@@ -487,7 +487,8 @@
                                        :body (vec (reverse block-body))
                                        :properties (:properties properties)
                                        :refs ref-pages-in-properties
-                                       :children (or current-block-children []))
+                                       :children (or current-block-children [])
+                                       :format format)
                                 (assoc-in [:meta :start-pos] start_pos)
                                 (assoc-in [:meta :end-pos] last-pos)
                                 ((fn [block]

+ 2 - 1
src/main/frontend/handler/editor.cljs

@@ -1902,7 +1902,8 @@
                   (db/entity [:block/original-name (state/get-current-page)])
                   (:block/page (db/entity (:db/id (state/get-edit-block)))))
          file (:block/file page)]
-     (when-let [editing-block (db/entity (:db/id (state/get-edit-block)))]
+     (when-let [editing-block (or (db/entity (:db/id (state/get-edit-block)))
+                                  (when (:block/dummy? (state/get-edit-block)) (state/get-edit-block)))]
        (let [parent (:block/parent editing-block)
              left (:block/left editing-block)
              sibling? (not= parent left)

+ 1 - 1
src/main/frontend/modules/outliner/core.cljs

@@ -331,7 +331,7 @@
            down-node (tree/-get-down target-node)]
        ;; update node's left&parent after inserted nodes
        (cond
-         (and (not sibling?) (some? right-node))
+         (and (not sibling?) (some? right-node) (nil? down-node))
          nil            ;ignore
          (and sibling? (some? right-node) topmost-last-loc) ;; right-node.left=N
          (let [topmost-last-node (zip/node topmost-last-loc)