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

Undo messes up bookmarks #116

Closed
insoluzioni opened this issue May 30, 2018 · 12 comments
Closed

Undo messes up bookmarks #116

insoluzioni opened this issue May 30, 2018 · 12 comments
Labels
bug sticky Relative to the Sticky feature
Milestone

Comments

@insoluzioni
Copy link

insoluzioni commented May 30, 2018

Hi there, I'm new here, still not sure how to use Github.
But I was really looking forward to bookmark tool in coding, and that's great, great job!

I found out that, if you undo your coding, all bookmarks loses their original position. So I have to bookmark them again....
For example, just copied & pasted a bunch of lines, then I undo it. The bookmarks immediately below are lost.

@alefragnani
Copy link
Owner

Hi @insoluzioni ,

First of all, sorry for taking so long to answer you. It's been a busy period. And thanks by your kind words 👍

I already noted this, sometimes, but unfortunately didn't find a replicate behavior. Sometimes it works, sometimes not 😢 . I would say that maybe, it's because how fast you type/undo.

If you could record your steps that reproduces the issue, it would help.

Thanks in advance.

@alefragnani alefragnani added bug sticky Relative to the Sticky feature labels Jun 16, 2018
@rpamely
Copy link

rpamely commented Sep 4, 2018

Hi, I started using VSCode bookmarks yesterday and have found bookmarks frequently loses their place as lines away from bookmarks are edited. Adding and removing lines, particularly through pasting seem to cause problems.

I have managed to record a gif of some cases that cause this. Firstly I found that adding a line ending in { and pressed delete (not backspace) at this line will usually make the bookmark shift down. Then if you try hard enough with adding new lines, pressing delete and undo you will eventually get the bookmark to jump to a completely different position. Both these issues can be seen in the gif.

Interestingly I found that that first issue of pressing delete moving the bookmark is actually undone by doing undo. Possibly this explains why it jumps later when you undo.

Hope this helps you. This is very helpful plugin that is currently quite unusable due to these issues. Thanks.

vscode bookmarks

@Awendel
Copy link

Awendel commented Sep 30, 2018

Same here, for as much as I'd love the plugin to work, it really isn't usable at all.

Spent like an hour adding bookmarks to a very large program but normally working on my code (incl copy & paste and undo/redo) messes up the lines (which I labelled with comments) - so it was all for nothing.

Since you put so much work into this, it'd be a shame if this minor bug compromises all the efforts into making it unusable.

@fmaiabatista
Copy link

I'd like to add that I also have this issue while using Prettier/ESLint combo for JS projects, which make use of the autoformat feature of the editor.

@alefragnani do you have a clue as to what may be causing this? (I mean, "Autoformat" should refresh bookmarks position)

@alefragnani
Copy link
Owner

@fmaiabatista, this was tracked in #118 and I added a workaround until a proper API/solution is provided.

Under User Preferences, add "bookmarks.useWorkaroundForFormatters": true. The bookmarks won't be removed anymore, It will not be sticked to the source code, but the line number itself.

Hope this helps

@fmaiabatista
Copy link

I see, I'll try it out! Thanks for the prompt response! 😄

@kanwisher
Copy link

Just noting that adding line breaks and then undoing them will move the position of the bookmark, despite which setting is enabled for useWorkaroundForFormatters. I'm not using any prettier programs or formatting. For my use case, I want to bookmark a location where a function call is made. But just through some basic editing, the bookmark will end up separating from the original location. With useWorkaroundForFormatters it sticks to the line number itself, but as code grows this doesn't serve any useful purpose. We were really excited about using this just to save time on quickly navigating to common parts of the codebase, however the problems outlined in this bug still exist and make the extension broken for our uses.

@mig8447
Copy link

mig8447 commented May 8, 2020

The extension is a great idea, I'd love to have my bookmarks saved but this issue makes it unusable for me, I also spent an hour or two bookmarking some project just to notice that the bookmarks were shifted when I edited the files.

I can dedicate a few hours to experiment and make a pull request if needed, but I'm not sure where to start, @alefragnani, would you have any pointers for me to start looking into this?

@jd-solanki
Copy link

+1

@StefanoGrossiNature
Copy link

Indeed this bug is very annoying and need to be fixed as soon as possible.
This is a bug in the CORE FEATURE of the extension,if it is not able to bookmark lines,please explain me why it is called that way?
Every hour i need to rearrange the bookmarks,and as me everyone.

It seems that is your approach,at the root,wich is wrong. It is so hard to simply attach the bookmark to a line number and constantly monitor it while the content change? If you can't do it,then save the current line text,or also 3 lines: 1 above,1 under and the bookmark line. Or else find a better approach but make it working! Look at ultraedit,it have this feature as default since 1990,and always worked perfectly. Why? Because the root approach it's correct.

@fade2gray
Copy link
Contributor

@StefanoGrossiNature
How much is an UltraEdit subscription and how mcuh have you contributed to this extension?

@StefanoGrossiNature
Copy link

StefanoGrossiNature commented Jan 29, 2021

@StefanoGrossiNature
How much is an UltraEdit subscription and how mcuh have you contributed to this extension?

Fine,then continue using a bugged extension,sorry if i bothered you all :-)
I am programmer since 25 years and when i publish something i publish something that WORK,else i prefer to change job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug sticky Relative to the Sticky feature
Projects
None yet
Development

No branches or pull requests

10 participants