mirror of https://github.com/logseq/logseq
fix: DWIM isn't activated at one-line block
parent
b4dbf1a04c
commit
1ae8087ae3
|
@ -91,7 +91,9 @@
|
||||||
[input]
|
[input]
|
||||||
(let [[content pos] (get-input-content&pos input)]
|
(let [[content pos] (get-input-content&pos input)]
|
||||||
(if (zero? pos) 0
|
(if (zero? pos) 0
|
||||||
(inc (string/last-index-of content \newline (dec pos))))))
|
(let [last-newline-pos (string/last-index-of content \newline (dec pos))]
|
||||||
|
(if (= nil last-newline-pos) 0 ;; no newline found (first line)
|
||||||
|
(inc last-newline-pos))))))
|
||||||
|
|
||||||
(defn line-end-pos
|
(defn line-end-pos
|
||||||
[input]
|
[input]
|
||||||
|
|
Loading…
Reference in New Issue