From e4934c6b5a862c0139b86518285d24c4feb70e64 Mon Sep 17 00:00:00 2001 From: tiye Date: Sun, 17 Sep 2023 16:10:06 +0800 Subject: [PATCH] fix unindent; tag 0.8.7 --- calcit.cirru | 30 ++++++++++++++++-------------- compact.cirru | 14 +++++++++----- package.cirru | 24 ++++++++++++------------ package.json | 2 +- 4 files changed, 38 insertions(+), 32 deletions(-) diff --git a/calcit.cirru b/calcit.cirru index 9dbbf8f..f2b12e9 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -1,6 +1,6 @@ {} (:package |app) - :configs $ {} (:init-fn |app.server/main!) (:port 6001) (:reload-fn |app.server/reload!) (:version |0.8.6) + :configs $ {} (:init-fn |app.server/main!) (:port 6001) (:reload-fn |app.server/reload!) (:version |0.8.7) :modules $ [] |lilac/ |memof/ |recollect/ |cumulo-util.calcit/ |ws-edn.calcit/ |bisection-key/ :entries $ {} :client $ {} (:init-fn |app.client/main!) (:reload-fn |app.client/reload!) @@ -15777,10 +15777,14 @@ |r $ %{} :Expr (:at 1625815134491) (:by |S1lNv50FW) :data $ {} |T $ %{} :Leaf (:at 1625815134491) (:by |S1lNv50FW) (:text |.includes?) - |j $ %{} :Expr (:at 1625815134491) (:by |S1lNv50FW) + |j $ %{} :Expr (:at 1694937632229) (:by |S1lNv50FW) :data $ {} - |T $ %{} :Leaf (:at 1625815134491) (:by |S1lNv50FW) (:text |:extra) - |j $ %{} :Leaf (:at 1625815134491) (:by |S1lNv50FW) (:text |bookmark) + |D $ %{} :Leaf (:at 1694937632830) (:by |S1lNv50FW) (:text |or) + |T $ %{} :Expr (:at 1625815134491) (:by |S1lNv50FW) + :data $ {} + |T $ %{} :Leaf (:at 1625815134491) (:by |S1lNv50FW) (:text |:extra) + |j $ %{} :Leaf (:at 1625815134491) (:by |S1lNv50FW) (:text |bookmark) + |b $ %{} :Leaf (:at 1694937633651) (:by |S1lNv50FW) (:text "|\"") |r $ %{} :Leaf (:at 1625815134491) (:by |S1lNv50FW) (:text |y) |v $ %{} :Expr (:at 1600312970289) (:by |S1lNv50FW) :data $ {} @@ -23617,12 +23621,10 @@ |T $ %{} :Expr (:at 1689420389280) (:by |S1lNv50FW) :data $ {} |T $ %{} :Leaf (:at 1689420389280) (:by |S1lNv50FW) (:text |:ir/unindent) - |b $ %{} :Leaf (:at 1689420389280) (:by |S1lNv50FW) (:text |op-data) |b $ %{} :Expr (:at 1689420389280) (:by |S1lNv50FW) :data $ {} |T $ %{} :Leaf (:at 1689420389280) (:by |S1lNv50FW) (:text |ir/unindent) |b $ %{} :Leaf (:at 1689420389280) (:by |S1lNv50FW) (:text |db) - |h $ %{} :Leaf (:at 1689420389280) (:by |S1lNv50FW) (:text |op-data) |l $ %{} :Leaf (:at 1689420389280) (:by |S1lNv50FW) (:text |sid) |o $ %{} :Leaf (:at 1689420389280) (:by |S1lNv50FW) (:text |op-id) |q $ %{} :Leaf (:at 1689420389280) (:by |S1lNv50FW) (:text |op-time) @@ -29117,7 +29119,6 @@ |r $ %{} :Expr (:at 1504777570689) (:by nil) :data $ {} |T $ %{} :Leaf (:at 1504777570689) (:by |root) (:text |db) - |j $ %{} :Leaf (:at 1504777570689) (:by |root) (:text |op-data) |r $ %{} :Leaf (:at 1504777570689) (:by |root) (:text |session-id) |v $ %{} :Leaf (:at 1504777570689) (:by |root) (:text |op-id) |x $ %{} :Leaf (:at 1504777570689) (:by |root) (:text |op-time) @@ -29220,16 +29221,17 @@ :data $ {} |T $ %{} :Leaf (:at 1627803433556) (:by |S1lNv50FW) (:text |:data) |j $ %{} :Leaf (:at 1627803434649) (:by |S1lNv50FW) (:text |expr) - |p $ %{} :Expr (:at 1627803478347) (:by |S1lNv50FW) + |p $ %{} :Expr (:at 1694938117562) (:by |S1lNv50FW) :data $ {} - |D $ %{} :Leaf (:at 1627803479496) (:by |S1lNv50FW) (:text |last) - |T $ %{} :Expr (:at 1627803476106) (:by |S1lNv50FW) + |T $ %{} :Leaf (:at 1694938117562) (:by |S1lNv50FW) (:text |nth) + |b $ %{} :Expr (:at 1694938117562) (:by |S1lNv50FW) :data $ {} - |D $ %{} :Leaf (:at 1627803477068) (:by |S1lNv50FW) (:text |first) - |T $ %{} :Expr (:at 1627803468900) (:by |S1lNv50FW) + |T $ %{} :Leaf (:at 1694938117562) (:by |S1lNv50FW) (:text |&map:destruct) + |b $ %{} :Expr (:at 1694938117562) (:by |S1lNv50FW) :data $ {} - |T $ %{} :Leaf (:at 1627803471911) (:by |S1lNv50FW) (:text |:data) - |j $ %{} :Leaf (:at 1627803475235) (:by |S1lNv50FW) (:text |expr) + |T $ %{} :Leaf (:at 1694938117562) (:by |S1lNv50FW) (:text |:data) + |b $ %{} :Leaf (:at 1694938117562) (:by |S1lNv50FW) (:text |expr) + |h $ %{} :Leaf (:at 1694938117562) (:by |S1lNv50FW) (:text |1) |r $ %{} :Leaf (:at 1627803442141) (:by |S1lNv50FW) (:text |expr) |T $ %{} :Expr (:at 1504777570689) (:by nil) :data $ {} diff --git a/compact.cirru b/compact.cirru index 128a0cc..ee4658b 100644 --- a/compact.cirru +++ b/compact.cirru @@ -1,6 +1,6 @@ {} (:package |app) - :configs $ {} (:init-fn |app.server/main!) (:reload-fn |app.server/reload!) (:version |0.8.6) + :configs $ {} (:init-fn |app.server/main!) (:reload-fn |app.server/reload!) (:version |0.8.7) :modules $ [] |lilac/ |memof/ |recollect/ |cumulo-util.calcit/ |ws-edn.calcit/ |bisection-key/ :entries $ {} :client $ {} (:init-fn |app.client/main!) (:reload-fn |app.client/reload!) @@ -2350,7 +2350,9 @@ and = :def $ :kind bookmark every? queries $ fn (y) - .includes? (:extra bookmark) y + .includes? + or (:extra bookmark) "\"" + , y .sort-by $ if blank? $ :query state , bookmark->str query-length @@ -3572,7 +3574,7 @@ (:ir/expr-after op-data) (ir/expr-after db op-data sid op-id op-time) (:ir/expr-replace op-data) (ir/expr-replace db op-data sid op-id op-time) (:ir/indent op-data) (ir/indent db op-data sid op-id op-time) - (:ir/unindent op-data) (ir/unindent db op-data sid op-id op-time) + (:ir/unindent) (ir/unindent db sid op-id op-time) (:ir/unindent-leaf op-data) (ir/unindent-leaf db op-data sid op-id op-time) (:ir/update-leaf op-data) (ir/update-leaf db op-data sid op-id op-time) (:ir/duplicate op-data) (ir/duplicate db op-data sid op-id op-time) @@ -4264,7 +4266,7 @@ do (println "\"Toggle comment at wrong place," node) node |unindent $ %{} :CodeEntry (:doc |) :code $ quote - defn unindent (db op-data session-id op-id op-time) + defn unindent (db session-id op-id op-time) let writer $ get-in db ([] :sessions session-id :writer) bookmark $ get (:stack writer) (:pointer writer) @@ -4277,7 +4279,9 @@ fn (expr) if = 1 $ count (:data expr) - last $ first (:data expr) + nth + &map:destruct $ :data expr + , 1 , expr -> db update-in diff --git a/package.cirru b/package.cirru index 64dced0..c3e9477 100644 --- a/package.cirru +++ b/package.cirru @@ -1,15 +1,15 @@ {} :dependencies $ {} - |calcit-lang/lilac |0.4.0-a2 - |calcit-lang/memof |0.0.14 - |Respo/respo.calcit |0.16.0-a3 - |Respo/respo-ui.calcit |0.5.0-a3 - |Respo/respo-markdown.calcit |0.4.0-a3 - |calcit-lang/recollect |0.0.14 - |calcit-lang/bisection-key |0.0.15 - |Respo/respo-message.calcit |0.0.7 - |Respo/respo-feather.calcit |0.3.0-a3 - |Respo/alerts.calcit |0.9.0-a2 - |mvc-works/ws-edn.calcit |0.0.9 - |Cumulo/cumulo-util.calcit |0.0.6 + |calcit-lang/lilac |main + |calcit-lang/memof |main + |Respo/respo.calcit |main + |Respo/respo-ui.calcit |main + |Respo/respo-markdown.calcit |main + |calcit-lang/recollect |main + |calcit-lang/bisection-key |main + |Respo/respo-message.calcit |main + |Respo/respo-feather.calcit |main + |Respo/alerts.calcit |main + |mvc-works/ws-edn.calcit |main + |Cumulo/cumulo-util.calcit |main diff --git a/package.json b/package.json index 46165e8..12b944d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@calcit/editor", - "version": "0.8.6", + "version": "0.8.7", "description": "Tree Editor for Calcit Language", "bin": { "ct": "./server.mjs"