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
Bookmark are realized by storing the file name and line number where the bookmark is added.
If the buf changes, the line number where the bookmark content is located may not match the real situation, the bookmark still points to the old one. Some time ago, I recorded the hash value of the line text where the bookmark is located. When the buf is saved, it will traverse all the bookmarks of the current buf, relative to the change of the total number of lines in the buf, look up or down for the line content equal to the bookmark hash value, and update the bookmark position, which works somewhat, but often fails. The fix_enable option is set to false by defalut.
I'm thinking of a better way to do it. 馃
Ideas welcome. 馃コ
Why not anchor bookmarks to a tree-sitter query?
Maybe as an optional requirement since I guess not everyone would want a bookmark plugin depending on tree-sitter
The text was updated successfully, but these errors were encountered:
Bookmark are realized by storing the file name and line number where the bookmark is added.
If the buf changes, the line number where the bookmark content is located may not match the real situation, the bookmark still points to the old one. Some time ago, I recorded the hash value of the line text where the bookmark is located. When the buf is saved, it will traverse all the bookmarks of the current buf, relative to the change of the total number of lines in the buf, look up or down for the line content equal to the bookmark hash value, and update the bookmark position, which works somewhat, but often fails. The fix_enable option is set to false by defalut.
I'm thinking of a better way to do it. 馃
Ideas welcome. 馃コ
Why not anchor bookmarks to a tree-sitter query? Maybe as an optional requirement since I guess not everyone would want a bookmark plugin depending on tree-sitter
I don't know about tree-sitter, I'm going to check the relevant documentation to see if it's possible.
Why not anchor bookmarks to a tree-sitter query?
Maybe as an optional requirement since I guess not everyone would want a bookmark plugin depending on tree-sitter
The text was updated successfully, but these errors were encountered: