mirror of
https://github.com/logseq/logseq.git
synced 2026-04-29 00:24:51 +00:00
fix: there's no auto-complete if the cursor moves back to [[]]
Related to #538
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
[goog.object :as gobj]
|
||||
[lambdaisland.glogi :as log]
|
||||
[cljs-bean.core :as bean]
|
||||
[frontend.util :as util]))
|
||||
[frontend.util :as util]
|
||||
[frontend.text :as text]))
|
||||
|
||||
;; TODO: replace with diff-match-patch
|
||||
(defn diff
|
||||
@@ -33,17 +34,6 @@
|
||||
(def inline-special-chars
|
||||
#{\* \_ \/ \` \+ \^ \~ \$})
|
||||
|
||||
(defn- get-current-line-by-pos
|
||||
[s pos]
|
||||
(let [lines (string/split-lines s)
|
||||
result (reduce (fn [acc line]
|
||||
(let [new-pos (+ acc (count line))]
|
||||
(if (>= new-pos pos)
|
||||
(reduced line)
|
||||
(inc new-pos)))) 0 lines)]
|
||||
(when (string? result)
|
||||
result)))
|
||||
|
||||
(defn- markdown-link?
|
||||
[markup current-line pos]
|
||||
(and current-line
|
||||
@@ -75,7 +65,7 @@
|
||||
|
||||
:else
|
||||
(recur r1 t2 (inc i1) i2))))
|
||||
current-line (get-current-line-by-pos markup pos)]
|
||||
current-line (text/get-current-line-by-pos markup pos)]
|
||||
(cond
|
||||
(and (= (util/nth-safe markup pos)
|
||||
(util/nth-safe markup (inc pos))
|
||||
|
||||
Reference in New Issue
Block a user