fix(org): list checkbox toggle on RET

A subtle change in the way org-toggle-checkbox handles its prefix
argument changed how RET (+org/dwim-at-point) handled list
checkboxes (incorrectlying swapping [ ] with [-], but not back, unless
the cursor was directly on top of the checkbox).
This commit is contained in:
Henrik Lissner 2024-02-17 07:11:48 -05:00 committed by Yann Esposito (Yogsototh)
parent a8496b258a
commit 9fce355e8e
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646

View file

@ -272,13 +272,12 @@ If on a:
(org-element-property :end lineage))
(org-open-at-point arg))))
((guard (org-element-property :checkbox (org-element-lineage context '(item) t)))
(org-toggle-checkbox))
(`paragraph
(+org--toggle-inline-images-in-subtree))
((guard (org-element-property :checkbox (org-element-lineage context '(item) t)))
(let ((match (and (org-at-item-checkbox-p) (match-string 1))))
(org-toggle-checkbox (if (equal match "[ ]") '(16)))))
(_
(if (or (org-in-regexp org-ts-regexp-both nil t)
(org-in-regexp org-tsr-regexp-both nil t)