fix(editor): wrong last pos when hashtag pressed

This commit is contained in:
Andelf
2022-02-10 12:36:02 +08:00
committed by Tienson Qin
parent e2ee41733d
commit c6d6871684

View File

@@ -2977,7 +2977,9 @@
hashtag?
(do
(commands/handle-step [:editor/search-page-hashtag])
(state/set-last-pos! (cursor/pos input))
(if (= key "#")
(state/set-last-pos! (inc (cursor/pos input))) ;; In keydown handler, the `#` is not inserted yet.
(state/set-last-pos! (cursor/pos input)))
(reset! commands/*slash-caret-pos (cursor/get-caret-pos input)))
(let [sym "$"]