mirror of https://github.com/logseq/logseq
enhance: both ^ and _ can be autopaired when there's selected text
parent
2bae2126b4
commit
f4a3d76658
|
@ -1496,15 +1496,19 @@
|
|||
"`" "`"
|
||||
"~" "~"
|
||||
"*" "*"
|
||||
;; "_" "_"
|
||||
"_" "_"
|
||||
"^" "^"
|
||||
;; ":" ":" ; TODO: only properties editing and org mode tag
|
||||
;; "^" "^"
|
||||
|
||||
})
|
||||
|
||||
(def reversed-autopair-map
|
||||
(zipmap (vals autopair-map)
|
||||
(keys autopair-map)))
|
||||
|
||||
(defonce autopair-when-selected
|
||||
#{"^" "_"})
|
||||
|
||||
(def delete-map
|
||||
(assoc autopair-map
|
||||
"$" "$"
|
||||
|
@ -2475,6 +2479,9 @@
|
|||
(util/stop e)
|
||||
(cursor/move-cursor-forward input))
|
||||
|
||||
(and (autopair-when-selected key) (string/blank? (util/get-selected-text)))
|
||||
nil
|
||||
|
||||
(contains? (set (keys autopair-map)) key)
|
||||
(do
|
||||
(util/stop e)
|
||||
|
|
Loading…
Reference in New Issue