markdown-mode
markdown-mode copied to clipboard
Imenu index should use markers
Expected Behavior
When generating a buffer Imenu index, index locations should be recorded as markers, allowing the user to edit the buffer and still navigate between indexes without performing a rescan.
Actual Behavior
When generating a buffer Imenu index, index locations are recorded as buffer positions, which means that if the user inserts or deletes text, any index after that point become inaccurate until performing a rescan.
Steps to Reproduce
-
$ emacs -Q -l markdown-mode.el - open a Markdown file with several headers
-
M-x imenu-add-menubar-index - menu > Index > [index item]
- enter text somewhere above this point
- repeat step 4
Backtrace
n/a
Software Versions
markdown-mode, version 2.4
GNU Emacs 28.0.50 (build 2, x86_64-apple-darwin17.7.0, NS appkit-1561.61 Version 10.13.6 (Build 17G14042)) of 2021-04-06
ProductName: Mac OS X
ProductVersion: 10.13.6
BuildVersion: 17G14042