dwim: delete list item with only bullet and checkbox

This commit is contained in:
leizhe
2021-10-07 21:02:06 +08:00
committed by Tienson Qin
parent 5fdfa0fa61
commit 515cf6f010

View File

@@ -2320,7 +2320,7 @@
(str (inc bullet) ".")
bullet)
checkbox (when checkbox " [ ]")]
(if (= (count full-content) (if ordered (+ (count bullet) 2) 2))
(if (= (count full-content) (+ (if ordered (+ (count bullet) 2) 2) (count checkbox)))
(delete-and-update input (cursor/line-beginning-pos input) (cursor/line-end-pos input))
(do (cursor/move-cursor-to-line-end input)
(insert (str "\n" indent next-bullet checkbox " ")))))