Fix cursor position

pull/645/head
Tienson Qin 2020-04-18 13:26:49 +08:00
parent b957cf95f8
commit 126c3b7ac7
1 changed files with 6 additions and 1 deletions

View File

@ -18,8 +18,13 @@
(let [[last-pos & rdeleted] (reverse deleted)
result (loop [last-pos last-pos
rdeleted rdeleted]
;; (prn {:last-char (nth markup last-pos)
;; :last-pos last-pos
;; :markup-length markup-length
;; :text text
;; :markup markup})
(cond
(and (= "\n" (nth markup last-pos))
(and (contains? #{" " "\n"} (nth markup last-pos))
(< last-pos markup-length)
(let [last-part (subs markup
(inc last-pos)