-
Notifications
You must be signed in to change notification settings - Fork 10
Description
If I understand correctly, currently the plugin works only with files that are static with regard to lines. Say you have notes on lines 6 and 13:
- If you add two new lines before line 4, the notes will not move to lines 8 and 15 along with the content but remain on the lines numbered ‘6’ and ‘13’, out of sync.
- Similarly, if you remove line 2, the notes will not move to lines 5 and 12.
- The canonical way to move lines around in *Vim is by yanking (
yy) and pasting (p). This will not move the associated notes along with the lines.
Do I miss anything? Is working with files which are not set in stone supported? Note that the signs shown when ShowNoteSigns() is set do move up and down together with their associated lines, even though this means they become misleading in fact; closing and reopening the buffer updates the locations of the signs.
Implementing the first two scenarios (adding and deleting lines) shouldn’t pose much of a problem: filenames for the relevant notes can be automatically renamed to reflect the changes. Moreover, if the notes are tracked with Git, it shouldn’t have a problem with tracking the filename changes. Care should be taken, though, if notes are open in NeoVim when their filenames are changed.
Implementing the third scenario is more tricky. One possible solution would be using hashes instead of line numbers, but this poses a new, different problem: how does the plugin distinguish now between lines with the same content now?
One way that can solve all problems at once is having a trailing comment with a UUID on each line that has a note. Having the annotated files ‘polluted’ with UUIDs is not desirable for many users, though.
Whatever the solution is, working with dynamic files is crucial for the utility of the plugin (which otherwise looks fantastic! 🤩). Notes are especially useful when working on a file, much more than annotating a file that won’t change, after the fact. Personally, my idea was to set filetype = "org" so I can write my WIP notes in Orgmode and integrate them with my general Orgmode workflow.
Thank you for writing this plugin 🙂🌼