mirror of
https://github.com/logseq/logseq.git
synced 2026-05-30 07:29:48 +00:00
Fix command completion firing too often
Only fire at the beginning of a line or when starting a new word
This commit is contained in:
@@ -98,6 +98,24 @@
|
||||
(is (= nil (state/get-editor-action))
|
||||
"Don't autocomplete properties if typing in a block where properties already exist"))
|
||||
|
||||
(testing "Command autocompletion"
|
||||
(handle-last-input-handler {:value "/"})
|
||||
(is (= :commands (state/get-editor-action))
|
||||
"Command search if only / has been typed")
|
||||
|
||||
(handle-last-input-handler {:value "some words /"})
|
||||
(is (= :commands (state/get-editor-action))
|
||||
"Command search on start of new word")
|
||||
|
||||
(handle-last-input-handler {:value "https://"})
|
||||
(is (= nil (state/get-editor-action))
|
||||
"No command search in middle of a word")
|
||||
|
||||
(handle-last-input-handler {:value "#blah/"})
|
||||
(is (= nil (state/get-editor-action))
|
||||
"No command search after a tag search to allow for namespace completion")
|
||||
)
|
||||
|
||||
(testing "Tag autocompletion"
|
||||
(handle-last-input-handler {:value "#"
|
||||
:cursor-pos 1})
|
||||
|
||||
Reference in New Issue
Block a user