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

View undo/redo history visually or an indicator or a counter #100717

Open
serious-angel opened this issue Jun 22, 2020 · 18 comments
Open

View undo/redo history visually or an indicator or a counter #100717

serious-angel opened this issue Jun 22, 2020 · 18 comments
Labels
feature-request Request for new features or functionality undo-redo Issues around undo/redo
Milestone

Comments

@serious-angel
Copy link

serious-angel commented Jun 22, 2020

Dear VSCode,

Thank you very much for this project.

Although, the feature we might need is the Undo/Redo history like in the VS2019 or Photoshop, for example:

Visual Studio 2019 Photoshop
image

or at least colored/highlighted buttons(without any history list) or counters (these numbers below show the number of Undoings the coder did (or number of Redo available to restore)):

or an indicator if any Redo is available.

The reason of this request is that without it the VSCode forces you to recheck if any edits have undone after returning to the project by clicking Ctrl+Shift+Z/Ctrl+Y and Ctrl+Z repeatedly etc. to ensure and not lose the undo/redo history by an accident.

In short, the there are 3 ways to implement.

1. The Undo/Redo history window(like on 1 picture above)
2. A global or per file Redo available counter(like on 2 picture above)
3. A global or per file Redo indication (Redo exists or not)

Just, imagine a situation:

You are coding a big code.
1. Ctrl+Z in one file so to view some code you rewrote.
2. Open/View different file.
3. Forget that you Undo first one
4. Return to first one
5. Write 1 char or reformat/beatify it accidentally
6. The whole Redo history of first file is **GONE** ... oops (what if full block of such or even more?!)

So, this request might eliminate this problem.

It might be already nearly implemented:
The Undo/Redo might already is stored in some object map or such, so just iterate through and do stuff. I.e. show the map in list or length of each map per file.

Interesting link which shows how might Emacs have such "feature".

Best regards

@serious-angel serious-angel changed the title View undo/redo history visually or an indicator View undo/redo history visually or an indicator or a counter Jun 22, 2020
@alexdima alexdima added feature-request Request for new features or functionality undo-redo Issues around undo/redo labels Jun 28, 2020
@alexdima alexdima removed their assignment Jun 28, 2020
@serious-angel
Copy link
Author

serious-angel commented Jun 28, 2020

@alexdima Sorry, may I ask how to correctly vote for backlog? Should the votes go to bot's message or the first message? Asking because of more votes, currently, exist on bot's message, not the first message. Will this impact the suggestion?

@scscgit
Copy link

scscgit commented Jul 6, 2020

At the very least the VS Code should implement a Local History (#26339) as soon as possible to cover any irrecoverable work loss. It makes no sense not to prioritize issues like this. Nobody really commits to Git so often that they would be exempt from this - at the very least, this could be implemented by having a second hidden Git repository, committing every change automatically on the background, and then letting us access that repository using any standard Git tool. Until someone finds the time to also implement a user friendly interface, this would be plenty and our basic needs would be covered. And it's not even that hard to do, check out https://stackoverflow.com/questions/505467/can-i-store-the-git-folder-outside-the-files-i-want-tracked :)

@serious-angel
Copy link
Author

serious-angel commented Jul 7, 2020

at the very least, this could be implemented by having a second hidden Git repository

Doesn't it already have some internal undo history logic? I mean, what happens when you press Ctrl+Z? The reason why asking this because the same text inputted same way into notepad.exe or similar undone differently comparing VSCode. VSCode's undoings are more logical and structured.

Also, the Git logic will not prevent from Redo overwrite at least some modified version of it.

@serious-angel
Copy link
Author

serious-angel commented Jul 15, 2020

@eamodio Sorry for pinging, but it's really important to know where people should append upvotes(likes?): to bot's or first message or these are summarized. Currently, it's 10 + 15, so 25 > 20, right? If different people upvoted comparing these buttons, of course.

Previous question to assigned person got no answer, so, I hope if you might answer.

Also, thank you all very much for upvoting this request. It should help the developers really much! Most developers might lose their edit history after overwriting their Undoings without this issue solved. Don't confuse with Version control systems(i.e. Git) which will compare between commits, but not files' Undoings.

Best regards and be safe!

@alexdima alexdima modified the milestones: Backlog Candidates, Backlog Jul 20, 2020
@alexdima
Copy link
Member

I don't know what the bot is counting. I believe it is counting votes on the first comment in the issue.

FYI @JacksonKearl @kieferrm -- maybe the bot should count votes also on its own comment.

@serious-angel
Copy link
Author

serious-angel commented Jul 20, 2020

Thank you very much, dear @alexdima

maybe the bot should count votes also on its own comment

Indeed, or, at least, slightly clarify what to upvote :)

@JacksonKearl
Copy link
Contributor

JacksonKearl commented Jul 20, 2020

Bot counts +1 reactions on the original issue. Added a section to the docs and a link to it to the comment. See: #102982

@serious-angel
Copy link
Author

serious-angel commented Jul 22, 2020

Bot counts +1 reactions on the original issue. Added a section to the docs and a link to it to the comment. See: #102982

Is that what you have added, recently? https://github.com/microsoft/vscode/wiki/Issues-Triaging#up-voting-a-feature-request
Thank you very much, dear @JacksonKearl! This definitely clarifies it.

@boltex
Copy link

boltex commented Aug 13, 2020

(re-pasting my question here )
My extension (https://github.com/boltex/leointeg) uses file system api to implement custom 'editors' for my needs as indicated in the docunmentation here https://code.visualstudio.com/api/extension-guides/virtual-documents#file-system-api .

I need to be able to 'block' or 'clear' undos when closing or switching from one of them to another.

It used to be that doing vscode.WorkspaceEdit "rename" operation would 'clear'/'block' all undos for the newly named document to traverse across the point where the document was renamed, but lately the newer versions of vscode tries to open a document with the old name when pressing ctrl+Z on a newly renamed document (in a custom filesystem)... Is there a way to disable that? Or a way to clear the undo stack for a given document URL? or for a filesystem scheme only in particular?

Thanks!

@alexdima
Copy link
Member

alexdima commented Sep 3, 2020

@mjbvz Please see the question above about undo/redo and custom editors.

@hepcat72
Copy link

I'd like this feature, but I'd also like an additional detail. Something (I'm guessing an extension) is actively reverting the actions of vscode-continue-inline-comments. The # that is automatically added when I hit return from the middile of a comment line is removing the # and I have no clue what is doing it. When I "undo", the first thing that happens is that the # is put back, so something is doing it and adding that to the undo/redo history and I'd line to figure out what that is so I can disable it.

@serious-angel
Copy link
Author

I'd like this feature, but I'd also like an additional detail. Something (I'm guessing an extension) is actively reverting the actions of vscode-continue-inline-comments. The # that is automatically added when I hit return from the middile of a comment line is removing the # and I have no clue what is doing it. When I "undo", the first thing that happens is that the # is put back, so something is doing it and adding that to the undo/redo history and I'd line to figure out what that is so I can disable it.

Does the same issue appear with all extensions disabled, or in pure/default VSCode build/instance with default configuration?

I would try debugging the VSCode itself. Have you tried profiling with Devtools right the moment the issue appears? I would suggest checking out the following: https://www.nicoespeon.com/en/2019/11/fix-vscode-extension-performance-issue/#record-extension-profile

Please also check the following: https://code.visualstudio.com/blogs/2021/02/16/extension-bisect

@hepcat72
Copy link

I'd like this feature, but I'd also like an additional detail. Something (I'm guessing an extension) is actively reverting the actions of vscode-continue-inline-comments. The # that is automatically added when I hit return from the middile of a comment line is removing the # and I have no clue what is doing it. When I "undo", the first thing that happens is that the # is put back, so something is doing it and adding that to the undo/redo history and I'd line to figure out what that is so I can disable it.

Does the same issue appear with all extensions disabled, or in pure/default VSCode build/instance with default configuration?

I would try debugging the VSCode itself. Have you tried profiling with Devtools right the moment the issue appears? I would suggest checking out the following: https://www.nicoespeon.com/en/2019/11/fix-vscode-extension-performance-issue/#record-extension-profile

Please also check the following: https://code.visualstudio.com/blogs/2021/02/16/extension-bisect

Actually, I figured it out shortly after posting this comment. I explain it here: https://stackoverflow.com/questions/77888484/how-to-set-visual-studio-to-prepend-a-comment-character-when-splitting-a-comment

@hepcat72
Copy link

hepcat72 commented Feb 13, 2024

And since then, I switched the setting from None to Pylance because "rename symbol" had disappeared from context menus (though I haven't tested comment line splitting since that update and I'm not at my desk ATM).

@hepcat72
Copy link

OK. I think I may have a better fix now. I changed "Pylance" to "Jedi" and now it doesn't delete # when I split a comment and I still get "Rename Symbol" in the context menus.

@flleeppyy
Copy link

when will we get this???

@WybeBosch
Copy link

when will we get this???

Doesnt the "Timeline" feature of vscode do what you want for this?
Image

@serious-angel
Copy link
Author

serious-angel commented Dec 6, 2024

when will we get this???

Doesnt the "Timeline" feature of vscode do what you want for this?

It does not, since it's a huge blown window/section instead of a few tiny 16x16 px buttons/indicators of the state, like ⤿ and .

For example, PHPStorm:

Image

Sure thing it has the history, too:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality undo-redo Issues around undo/redo
Projects
None yet
Development

No branches or pull requests

9 participants