mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
lang/org: use correct todo keyword on M-RET
Previously, new TODO headers created with M-RET or M-S-RET (bound to +org/insert-item) would use the first TODO keyword in org-todo-keywords in the new header. This wouldn't necessarily match the previous header. e.g. * [ ] Item 1 * TODO | This fix ensures new headers will preserve the correct header, even if the previous one is in a DONE state. * [ ] Item 1 * [ ] |
This commit is contained in:
@ -203,8 +203,9 @@ wrong places)."
|
||||
(save-excursion
|
||||
(insert "\n")
|
||||
(if (= level 1) (insert "\n")))))
|
||||
(when (org-element-property :todo-type context)
|
||||
(org-todo 'todo))))
|
||||
(when-let* ((todo-keyword (org-element-property :todo-keyword context)))
|
||||
(org-todo (or (get-text-property 0 'org-todo-head todo-keyword)
|
||||
'todo)))))
|
||||
|
||||
(t (user-error "Not a valid list, heading or table")))
|
||||
|
||||
|
Reference in New Issue
Block a user