You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: promote headline while refile to file-end (#641)
* fix: promote headline while refile to file-end
- promote headlines to first level when archiving (like Emacs)
- promote headlines to first level when refiling without targeting a
headline (Emacs only allows headlines as refiling targets)
Motivation:
Refiling to file-ends is only indirectly used in Emacs Org-Mode for
archiving. In this case Org-Mode promotes headlines to the first
level in the archive file.
This fix aligns the archiving-behavior with Emacs while also adapting
the normal refiling feature when no headline was given.
This has two advantages: It prevents the user from getting wrong and
unexpected structures in org-files and archive-files and it aligns
Nvim-Orgmode more with the original Emacs Org-Mode.
* chore: remove superfluous refile functions
Because the main logic is now consolidated in Capture:_refile_to,
the two functions Capture:refile_to_headline and Capture:_refile_to_end
are not needed anymore.
Adjust the tests accordingly.
Note:
A general refactoring of the Capture class would be helpful in the
future. The current Capture class mixes several concerns: Refiling,
capturing and archiving. Separating these into different classes might
help to make the code easier to understand and to adjust.
---------
Co-authored-by: Sebastian Flügge <[email protected]>
0 commit comments