fix: don't show autocomplete commands when paste a link

pull/674/head
Tienson Qin 2020-11-17 16:41:28 +08:00
parent 4bad2b991c
commit fdc201433c
1 changed files with 5 additions and 3 deletions

View File

@ -683,9 +683,11 @@
last-input-char (util/nth-safe value (dec current-pos))]
(case last-input-char
"/"
(when-let [matched-commands (seq (editor-handler/get-matched-commands input))]
(reset! *slash-caret-pos (util/get-caret-pos input))
(reset! *show-commands true))
(let [prev-char (util/nth-safe value (dec (dec current-pos)))]
(when (string/blank? prev-char)
(when-let [matched-commands (seq (editor-handler/get-matched-commands input))]
(reset! *slash-caret-pos (util/get-caret-pos input))
(reset! *show-commands true))))
"<"
(when-let [matched-commands (seq (editor-handler/get-matched-block-commands input))]
(reset! *angle-bracket-caret-pos (util/get-caret-pos input))