alefragnani / vscode-bookmarks

Bookmarks Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks
GNU General Public License v3.0
1.7k stars 163 forks source link

[BUG] - Bookmarks disappear after changing branch #578

Closed francescotaioli closed 1 year ago

francescotaioli commented 1 year ago

HI! thanks for the great extension!

I've found an issue. Below the steps to reproduce it:

Environment/version

Steps to reproduce

  1. Add bookmarks to a file
  2. Change branch
  3. Return to previous branch
  4. Bookmarks disappeared
alefragnani commented 1 year ago

Hi @francesco-taioli ,

The extension has no connection or dependency to branches or any other VCS feature so, the sole fact of changing branches wound’t make any difference.

But, if a bookmarks is located in a file that doesn’t exist in the other branch or, is located in a line in some file that has changed, and that specific line does not exist in the other branch, bookmark will be deleted. This happens because that bookmark wouldn’t describe a valid location and so, you would end up with orphan bookmarks.

If you change branches very often, and need your bookmarks to be kept, I suggest you to take a look at the bookmarks.saveBookmarksInProject setting. This will make the bookmarks to be stored within the repo, keeping it in sync with the valid files/locations.

Hope this helps