Skip to content
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

Bookmark stays in the same line numbers #137

Open
aaxu opened this issue Jan 10, 2018 · 2 comments · May be fixed by #147
Open

Bookmark stays in the same line numbers #137

aaxu opened this issue Jan 10, 2018 · 2 comments · May be fixed by #147

Comments

@aaxu
Copy link
Contributor

aaxu commented Jan 10, 2018

One thing I did not address is how bookmarks can be deleted. While we have the command bm- to delete a bookmark, some editors make it so that you can delete a bookmark if you remove enough lines around the bookmark. I don't think this is a major issue, since I think that if a person bookmarks an area and deletes a line, they may come back to that same place.

However, just to be clear, right now, the bookmark does not move, so if you have a bookmark on line 15 and remove 10 lines around the bookmark, the bookmark will still be on line 15. I want to somehow make it so that the bookmark stays relative to the text it covers, but it seems difficult.
For example, if the editor was like this:

a
b
c <--- bookmark here
d
e

and I erase lines a and b, then the editor should look like this:

c <--- bookmark here
d
e

And the reverse would also be true if I add lines a and b back.

@aaxu
Copy link
Contributor Author

aaxu commented Jan 10, 2018

I found one bug in particular, where if you make a bookmark, then erase enough lines so that the number of lines is less than the position of the bookmark, if you press F2 to go to bookmark, it will crash the program. I'm thinking we could fix this by clearing out-of-bounds bookmarks whenever we decrease the number of lines, but it looks like we do that in multiple places.

@Androbin Androbin linked a pull request Feb 2, 2018 that will close this issue
@Androbin
Copy link

Androbin commented Feb 2, 2018

During my work on the PR (#147), I realized that there are some edge cases where there are multiple sensible options on when/how to change the bookmark range. There are for examples differences between changes to the start/middle/end of lines and/or changes to the start/end of the bookmark range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants