alefragnani / vscode-bookmarks

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

[BUG] - Bookmark deleted after git revert any changes on any non-bookmarked lines #507

Closed elliotching closed 5 months ago

elliotching commented 2 years ago

Environment/version

Steps to reproduce

  1. enable "Bookmark > Experimental : new sticky engine" in setting
  2. create an empty folder
  3. init git inside that folder
  4. create an empty file name a.txt and type more then 10 lines in a.txt file
  5. git commit that file (commit in local only)
  6. make 1 to 3 bookmarks on any lines on a.txt
  7. make some changes on any lines that are not bookmarked
  8. using VSCode util to git revert the changes lines
  9. observe the bookmarks made on step 5 are missing.

https://user-images.githubusercontent.com/20972678/151117799-df53ab8e-4a04-4aef-8a12-cc3e14f35b69.mov

alefragnani commented 5 months ago

Hi @elliotching ,

The bookmarks lost sync because Git operations (even those fired by VS Code commands) updates the file outside the context of the text editor, and the extension only recognizes changes made by the user while editing files. If instead of reverting the changes using Git command, you use Undo command, the support is better. Similar issues were reported in https://github.com/alefragnani/vscode-bookmarks/issues/604, https://github.com/alefragnani/vscode-bookmarks/issues/224 and https://github.com/alefragnani/vscode-bookmarks/issues/177,

Right now, I have no plans support git operations, as I'm planning to focus on other areas of the extension. But I'm aware of the limitation, and once I'm able to improve the sticky behavior, Git support is the next objective.

Thanks for your understanding.