Closed sdwolfz closed 7 years ago
I've marked it as [WIP]
until I add some tests.
This PR ads some utility functions: ... Let me know what you think about this PR!
This seems like a good idea. Thanks for proposing
I have a couple of questions that I inlined as comments.
I've marked it as [WIP] until I add some tests.
Awesome.
I've added unit tests. The save-excursion
did not work for deleting a TOC so I updated the code to use the old logic.
This PR ads some utility functions:
markdown-toc-delete-toc
: Delete a TOC from anywhere without losing cursor position.markdown-toc-refresh-toc
: Refresh a TOC from anywhere without losing cursor position.markdown-toc-generate-or-refresh-toc
: This is a one size fits all function to generate and refresh a TOC.These are all for interactive usage. Also
markdown-toc-refresh-toc
can for example be used in abefore-save
hook for markdown files.Let me know what you think about this PR!