Sublime Forum

Undo Tree Implementation and Visualization

#6

I’ve messed around with hooking the undo command and utilizing view.command_history before and my experiences weren’t too great. I honestly would prefer this to be implemented as a core feature.

0 Likes

#7

Me as well! This is such an excellent feature I would be willing to “chip in” to pay someone to make a high quality extension like Gundo!

0 Likes

#8

In light of the forum refresh, heres a bump!

0 Likes

#9

heres another one!!

0 Likes

#10

and yet another!

@unphased It just might have to be you! :grin:

0 Likes

#11

I don’t use sublime anymore. It’s all about Vim!

0 Likes

#12

Another bump!

0 Likes

#13

Another bump!

0 Likes

#14

Another one!

0 Likes

#15

And another!

0 Likes

#16

Update: The bitbucket site seems to be down.

A mirror can be found on: https://github.com/sjl/gundo.vim

and a Screenr: http://www.screenr.com/M9l

0 Likes

#17

Another bump!

@valerij_ I re-read your recommendation. Do you know of any plugins that do something similar that could be used a starting point?

(Note: My strategy from now on is to bump every time I need this feature in real life, with a minimum bump-interval of two weeks)

0 Likes

#18

@diego898 I doubt this is coming any time soon because of quite little return on investment. The feature being requested is quite complicated and there isn’t exactly a big demand for it.

You could try working on a plugin to do this, though. You could make use of Vcs to handle multiple branches etc.

0 Likes

#19

not really.

per se, this wont be that much of a hassle, just create a tree structure, have an (git like) HEAD where you append new states. The only thing i dont really know is how to hook existing functionality which pushes states to the undo stack, but i guess one could just hook all edit events and push that. The developer of Braid had a good talk about how to have a lot of undo information while not utilizing a ton of memory, those ideas would be useful here.

as for visualization, i would copy the code from git to layout and draw the tree in ascii.

as @FichteFoll said, you could even try using a in-memory VCS, maybe dulwich can be hacked that way

0 Likes

#20

Just a note here that such a package has been developed and added to Package Control:

https://packagecontrol.io/packages/Sublundo

4 Likes

Sublundo: Vim-like persistent, branching undo
#21

Thank you. I only now saw this thread. This sounds like an amazing feature. I’ve installed the plugin and am hoping it works well. But I agree the underlying functionality would be better in the core. I hope the Sublime Text developers will consider adding it.

0 Likes

#22

I am so glad that someone has taken on the challenge! I encourage everyone to be involved in the github repository anyway they can to push this forward!

Also, I strongly encourage the core team to integrate this functionality!!

0 Likes

#23

I’ll give it a shot. It’s been awhile since I’ve worked in vi/vim/gvim but improved undo functionality is always a nice thing as long as it seems to behave intuitively (or mostly intuitively until intuition is retrained.)

0 Likes

#24

Just another bump!!

0 Likes

#25

I’ve been working on my Acecool Code Mapping System for some time working on making it stand-alone, and now adding features and getting it ready for version 1…

One of those features it a region mapping output system so instead of double clicking a single line, exploding on : to get the code entry / info and line number to jump to the line - I’ll be able to map every bit of text meaning every character could be a link to something…

The default links I want to include are: Jump to line in code, insert snippet at last active cursor spot in source-code view, a control panel to allow searching using filter / mask toggles for the entire output… and some more…

Plus other features…

The point of my system is that anyone will be able to make mappable regions output to one of the plugins panels ( by default one panel will open, although I will likely have the toolbox stand alone which acts as a dropdown would for an ide to show / hide data based on the search / selection for classes, etc… in the output panel ) with the option to add more panels either stacked, or along side ( later with extra windows or vgui panels external to sublime text ) as options… I need to set up the entire dynamic panel system and the output system but I am working on it along with other things in the project…

Someone suggested adding macros as a clickable - and it would be doable… Someone else posted asking for a bookmarks bar ( ie quick links to bookmarks in a file with an easy output linking to them ) so I plan on adding output categories for macros, bookmarks and the like and those categories can then be output to the other panels ( is how I’m designing it )…

I’m not familiar with this particular system? - but it looks like each change is logged when you stop typing for n seconds so you can click to undo that alteration or redo it without affecting other elements of code…

I have been planning on adding a backup system to my plugin because I cache the output anyway and will need to cache the panel region mapping too so I figured it is somewhat similar so saving a copy of the file the user edits every n saves or if t time has passed since the last save or x data has been added / removed / altered with options to keep n saves for t time before removing them with a bunch of other clauses…

An edit tracking system wouldn’t be too far off what I’m already doing and it could be input into a super slim panel with minimalistic data to represet the changes ( on click could highlght the change and double-click could remove the change or redo it )

It will be possible with my addon, eventually - but it is going to be a while before I’d be able to get to it…

I’m throwing this out there because of the age of this thread and because it seems to be a feature which is in demand so people know what is going to be possible with my single add-on which will serve as a complete code mapping system especially with the new region system where every character on a line can be a link to something different also meaning data on a line doesn’t need to include back-end data just to perform a function saving space…

0 Likes