Live data from Hacker News

Resolving the great undo-redo quandary

github.com

101–110 of 247 posts

Re: Resolving the great undo-redo quandary

#101
> you can use up all available memory in approx. 64 quick steps by: Type 1 character; Undo to beginning; Type 1 character; Undo to beginning; etc

This is fine because "undo to beginning" isn't a single action. Each time this loop runs, the user spends more and more time mashing undo to get back to the beginning. The number of actions in the history is only increasing by a constant amount per user action.

Re: Resolving the great undo-redo quandary

#102
Vim has this, it's :earlier and :later

https://vimtricks.com/p/vimtrick-time-travel-in-vim/

    :earlier 3 – Undo the last 3 changes
    :earlier 5m – Go back to the state of the file 5 minutes ago
    :later 2 – After undoing something, redo the next 2 changes
    :later 1h – Travel forward through the change history 1 hour
Vim also stores the tree of changes, but it's a pain to access without plugins.

Re: Resolving the great undo-redo quandary

#103
post #46

Earlier quoted context omitted.

There is a sidebar widget. But it starts merged in the File Explorer view, and you need to drag it over from there to the sidebar to make it independent - https://stackoverflow.com/a/71522634 The widget is called "Timeline". > The cool thing with IntelliJ is if you accidentally deleted a file you can just touch a blank version of the file and the history comes back. Not sure if VS Code does that yet. VS Code does kee…

Fantastic! Thank you so much. I think it's a fairly common situation that people using programming tools (VS Code, git, vim etc) can go for years without realizing there is a built-in feature that can solve exactly a problem they always struggled to solve. I'm not sure how to surface that sort of functionality in the tool, but I'm glad HN is here to point it out. One similarly cool thing I learned in a recent comment…

It helps to read the VS Code monthly update release notes, it takes about 3 min, but you'll be aware of all new features they introduce.

Re: Resolving the great undo-redo quandary

#104
post #96

Earlier quoted context omitted.

Yes! Having regional undo is super useful sometimes. I switched from emacs to vim a long time ago, but still miss this feature (although not enough to go searching to find an equivalent vim plug in I guess). Lazy web?

Well if you want to return to Emacs, I can attest as a former long-time vim user that the emulation layers for vim modes in Emacs are fantastic! They're really the only good part of vim, as the configuration language was always a bit less desirable than elisp, imo.

I've tried in past but always found the vim modes to be a bit lacking. My last attempt was probably 6 or 7 years ago though so maybe worth another shot!

Re: Resolving the great undo-redo quandary

#105
post #32

This is exactly how undo works in Emacs out of the box. Personally, I prefer to install the undo-tree package and manually browse through the tree of undo paths. I'm not sure why this author finds a tree unacceptable for this purpose.

He literally says why at the top of the post. People find it too complicated.

I confess I didn't get that the post was about emacs. Reading the intro, it sounds more like it assumes nobody ever implemented something. And then goes on to describe what sounds a lot like how emacs works.

Re: Resolving the great undo-redo quandary

#106
Then there's Undo/Redo for navigating relationships (1994, interactive music video, Macromedia Director, Mark Canter, Meet MediaBand, UnDo Me):

Meet MediaBand (2/5) - UnDo Me

https://www.youtube.com/watch?v=8E-Sc9XafmE

>The second of two interactive music videos on Canter Technology's Meet MediaBand CD-ROM, UnDo Me could very well be considered the "Choose Your Own Adventure" of music videos - in that MediaBand's lead singer, Kelly Gabriel, has to choose from one of four different relationships. YOU help Kelly decide which one to try, and navigate her way through each relationship.

>At the end of each chorus, you are asked to make a branching decision based on whether Kelly should be passive (ice) or aggressive (fire) with the guy she's going out with. Things not turning out well for her? At any time you could "UnDo the past" and choose a different guy, or even jump back to a certain point in the relationship and change your decisions.

>Four separate videos were produced for each relationship (concluding in a total of 16 possible outcomes), connected together with an intro, a home chorus and reverse/"UnDoing" sections. As you could probably tell each section has a different musical style, reflecting the mood and personalities of the relationship that section represents. A version of the song can also be found as a separate CD audio track on the Meet MediaBand CD-ROM.

Meet MediaBand by Marc Canter (1994):

https://www.youtube.com/watch?v=0dRZ52wM84Q

https://www.ebay.com/itm/325099461299

Re: Resolving the great undo-redo quandary

#108
post #23

Earlier quoted context omitted.

VS Code has that feature too, but only for individual files.

I wish VS Code would expand on that feature, coming from IntelliJ. It's really annoying that you need to type the name of the file you want to see the local history of, even when it's the currently active file in the editor. There should be a sidebar widget for it that's active for whatever the current file is. The cool thing with IntelliJ is if you accidentally deleted a file you can just touch a blank version of th…

Or you can just look at the history of the folder.

Re: Resolving the great undo-redo quandary

#109
Intellij enables multifile changes, renames, file moves with multiple files as single operation, as well as reload from disk, which breaks this simple linear history model afaiu. There is also a separate linear time-based local history in case you screw up. How intellij handles this is the best, in my mind, because of simplicity and separate "I screwed up" mode.
Post reply on HN