mirror of
https://github.com/logseq/logseq.git
synced 2026-05-03 02:16:30 +00:00
enhance: both ^ and _ can be autopaired when there's selected text
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user