mirror of https://github.com/logseq/logseq
Enhance: don't move to the previous block when there's highlighted area and pressing `left`
parent
b5d9200f82
commit
6b249aa865
|
@ -2369,8 +2369,9 @@
|
|||
|
||||
(defn- on-arrow-move-to-boundray
|
||||
[state input e direction]
|
||||
(when (or (and (= :left direction) (util/input-start? input))
|
||||
(and (= :right direction) (util/input-end? input)))
|
||||
(when (and (not (util/input-selected? input))
|
||||
(or (and (= :left direction) (util/input-start? input))
|
||||
(and (= :right direction) (util/input-end? input))))
|
||||
(move-to-block-when-cross-boundrary state e direction)))
|
||||
|
||||
(defn keydown-arrow-handler
|
||||
|
|
|
@ -765,6 +765,12 @@
|
|||
(= (count (.-value input))
|
||||
(.-selectionStart input)))))
|
||||
|
||||
#?(:cljs
|
||||
(defn input-selected?
|
||||
[input]
|
||||
(not= (.-selectionStart input)
|
||||
(.-selectionEnd input))))
|
||||
|
||||
#?(:cljs
|
||||
(defn get-selected-text
|
||||
[]
|
||||
|
|
Loading…
Reference in New Issue