Add back fix from #6147 along with its test cases

Also fix testing sexp and reset state
This commit is contained in:
Gabriel Horner
2022-11-22 14:43:29 -05:00
committed by Tienson Qin
parent 674022d4fb
commit 3440a3d433
2 changed files with 35 additions and 12 deletions

View File

@@ -1859,7 +1859,9 @@
(state/clear-editor-action!)
;; Open "Search page or New page" auto-complete
(= last-input-char commands/hashtag)
(and (= last-input-char commands/hashtag)
;; Only trigger at beginning of line or before whitespace
(or (= 1 pos) (contains? #{" " "\t"} (get (.-value input) (- pos 2)))))
(do
(state/set-editor-action-data! {:pos (cursor/get-caret-pos input)})
(state/set-editor-last-pos! pos)