-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow editing files without breaking bookmark jumps #12
Comments
It is surely a performance killer if the marks get updated when user is typing. If you do implement this one, I think it'd better to leave a option there to determine whether the marks will get updated dynamically; thus, users cares about performance can benefit that. For me, bookmarks are used when i am reading code. If massive code is being written, I seldom use bookmarks. |
My solution for this might be: keep the bookmarks sorted by their line numbers.then when the file is being edited. you can use binary search to quickly updated the bookmarks. |
I agree with you that bookmarks are mainly used for read-only tasks. But in the current state line number and visual display get easily out of sync by just adding one line on top. That should be addressed. Actually we would not have to update after each edit because:
When updating one buffer we can just ask for the signs in the current buffer ( I don't quite understand your second comment as I don't know of any Thanks for your thoughts! |
Alright, I created branch where I tried the new approach: 48cf995 If you don't mind please have a look and give it a try. I don't think performance will become a problem. Even though there is one more case where I had to update the line numbers based on the signs: When I jump to the prev/next bookmark. |
The reason for that is, that our own model (
g:bm_entries
) doesn't get updated when lines are added above/below the bookmark. That means our model and and the displayed signs easily get out of sync. Also I don't know of any solution yet on how to properly update our own model after the user edits the file (does someone know?).Solution
line_nr
from our own modelConcerns
The text was updated successfully, but these errors were encountered: