feat: toggle formatting of selected area instead of double-wrapping

enhance: select formatted text after changing its formatting for toggle support
fix: place cursor between (pattern)(pattern) pair when selection is empty
This commit is contained in:
Amar Sood (tekacs)
2021-06-10 19:41:52 -04:00
parent 0bde30bc58
commit d7983322f6
2 changed files with 19 additions and 10 deletions

View File

@@ -58,6 +58,9 @@
(= (count (.-value input))
(.-selectionStart input))))
(defn set-selection-to [input n m]
(.setSelectionRange input n m))
(defn move-cursor-to [input n]
(.setSelectionRange input n n))