mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Don't move cursor when toggling folds in org-mode
This commit is contained in:
@ -127,14 +127,16 @@ wrong places)."
|
|||||||
"Toggle the local fold at the point (as opposed to cycling through all levels
|
"Toggle the local fold at the point (as opposed to cycling through all levels
|
||||||
with `org-cycle'). Also removes babel result blocks, if run from a code block."
|
with `org-cycle'). Also removes babel result blocks, if run from a code block."
|
||||||
(interactive)
|
(interactive)
|
||||||
(org-babel-when-in-src-block
|
(save-excursion
|
||||||
(call-interactively 'org-babel-remove-result-one-or-many))
|
(org-beginning-of-line)
|
||||||
(cond ((org-at-heading-p)
|
(cond ((org-in-src-block-p)
|
||||||
(outline-toggle-children))
|
(org-babel-remove-result))
|
||||||
((org-at-item-p)
|
((org-at-heading-p)
|
||||||
(let ((window-beg (window-start)))
|
(outline-toggle-children))
|
||||||
(org-cycle)
|
((org-at-item-p)
|
||||||
(set-window-start nil window-beg)))))
|
(let ((window-beg (window-start)))
|
||||||
|
(org-cycle)
|
||||||
|
(set-window-start nil window-beg))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org/toggle-checkbox ()
|
(defun +org/toggle-checkbox ()
|
||||||
|
Reference in New Issue
Block a user