mirror of
https://github.com/logseq/logseq.git
synced 2026-04-27 15:45:00 +00:00
refactor: extract out cursor pos function
This commit is contained in:
@@ -34,6 +34,10 @@
|
||||
:left js/Number.MAX_SAFE_INTEGER
|
||||
:top js/Number.MAX_SAFE_INTEGER}))))
|
||||
|
||||
(defn pos [input]
|
||||
(when input
|
||||
(.-selectionStart input)))
|
||||
|
||||
(defn move-cursor-to [input n]
|
||||
(.setSelectionRange input n n))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user