mirror of
https://github.com/logseq/logseq.git
synced 2026-04-30 17:06:23 +00:00
fix(editor): page search autocompletion with square brackets mixed
Fix #4178
This commit is contained in:
@@ -660,7 +660,7 @@
|
||||
(fn [chosen _click?]
|
||||
(state/set-editor-show-page-search! false)
|
||||
(let [wrapped? (= "[[" (util/safe-subs edit-content (- pos 2) pos))
|
||||
chosen (if (string/starts-with? chosen "New page: ")
|
||||
chosen (if (string/starts-with? chosen "New page: ") ;; FIXME: What if a page named "New page: XXX"?
|
||||
(subs chosen 10)
|
||||
chosen)
|
||||
chosen (if (and (util/safe-re-find #"\s+" chosen) (not wrapped?))
|
||||
@@ -677,7 +677,7 @@
|
||||
(str "#" (when wrapped? "[[") chosen)
|
||||
format
|
||||
{:last-pattern last-pattern
|
||||
:end-pattern "]]"
|
||||
:end-pattern (when wrapped? "]]")
|
||||
:forward-pos forward-pos})))
|
||||
(fn [chosen _click?]
|
||||
(state/set-editor-show-page-search! false)
|
||||
|
||||
Reference in New Issue
Block a user