integral-dw/org-superstar-mode

Setting org-superstar-remove-leading-stars to t breaks some built-in org movement commands.

Closed this issue · 4 comments

I recently discovered that setting (setq org-superstar-remove-leading-stars t) makes the org-{forward,backward}-heading-same-levelcommand ineffectual when the cursor is hovering on a subheading. However, those commands will work as intended on top level headings - presumably because there is nothing for org-superstar-remove-leading-stars to do on such headings.

I'm using GNU Emacs 26.3.

Hi, I'll have to look into this in greater detail, but it stems from the fact that org realizes that the heading is partially invisible, but not that it's not entirely invisible, leading to some inconsistent behavior. That is why the functions seem to work if their optional second argument is non-nil. So in other words, this hack seems to work as expected

(defun my-forward-heading-same-level (arg)
  (interactive "p")
  (org-forward-heading-same-level arg t))
(defun my-backward-heading-same-level (arg)
  (interactive "p")
  (org-backward-heading-same-level arg t))

I'll have to mull over this a bit and most likely contact the mailing list to come up with the least intrusive solution to this.

Quick update: I fixed up a patch for org-mode to take care of the issue, and it will most likely find its way upstream some time the coming week. It looks like no code change will be necessary on this end.

Thank you! I'll continue using your work around code in the meantime.

The patch has been accepted!