enhance: properties inserting

Multiple properties drawers are allowed for now, this PR limits the
creation of multiple drawers to make sure that each block has only
one. Call <properties multiple times will insert the property in same drawer.
This commit is contained in:
leizhe
2021-10-20 10:04:16 +08:00
committed by Tienson Qin
parent 0be5859ed0
commit 8f2140e537
4 changed files with 233 additions and 132 deletions

View File

@@ -121,11 +121,21 @@
[input]
(move-cursor-to input (line-beginning-pos input)))
(defn move-cursor-to-beginning
[input]
(move-cursor-to input 0))
(defn move-cursor-to-end
[input]
(let [pos (count (gobj/get input "value"))]
(move-cursor-to input pos)))
(defn move-cursor-to-thing
[input thing from]
(let [[content _pos] (get-input-content&pos input)
pos (string/index-of content thing from)]
(move-cursor-to input pos)))
(defn move-cursor-forward-by-word
[input]
(let [val (.-value input)