lang/org: preserve indent on new item (M-RET)
This commit is contained in:
parent
6c3c40e41e
commit
d52ee9c3be
1 changed files with 6 additions and 3 deletions
|
@ -70,14 +70,17 @@ wrong places)."
|
|||
t))
|
||||
(type (org-element-type context)))
|
||||
(cond ((eq type 'item)
|
||||
(let ((marker (org-element-property :bullet context)))
|
||||
(let ((marker (org-element-property :bullet context))
|
||||
(pad (save-excursion
|
||||
(back-to-indentation)
|
||||
(- (point) (line-beginning-position)))))
|
||||
(pcase direction
|
||||
('below
|
||||
(goto-char (line-end-position))
|
||||
(insert (concat "\n" marker)))
|
||||
(insert (concat "\n" (make-string pad ? ) marker)))
|
||||
('above
|
||||
(goto-char (line-beginning-position))
|
||||
(insert marker)
|
||||
(insert (make-string pad ? ) marker)
|
||||
(save-excursion (insert "\n")))))
|
||||
(when (org-element-property :checkbox context)
|
||||
(insert "[ ] ")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue