Hi,
I have a little feature request I would like to discuss about. I think I remember from a previous discussion that Allan prefers to have those kind of discussions on the mailing list rather than on github, so here I go.
One of the few things I appreciate when using such monstrosities as Eclipse is the support for local history. Of course, there is version control to achieve something similar, but sometimes, local history is just better (for example, the fact that it automatically records edit history, instead of relying on explicitly committing a change; and sometimes, it's just bad practice to commit tiny changes to a repository).
Of course, implementing such a thing for Textmate is a vast task. However, there is one use case that seems to cover most of my uses of local history in Eclipse and alike, which is the ability to easily revert to a clean state when I want to try something. I can imagine that this can be easily obtained in Textmate by having commands such as "set bookmark in undo history" and "undo to last bookmark in undo history". My workflow would be simply to set an undo history bookmark before I want to try a few risky changes, then easily revert those changes just by calling the undo to bookmark command. This would give me a simple way to avoid repetitive calls to undo, which can be tedious and risky (since it's not always obvious to see what you're undoing and there is the risk of undoing some steps too far).
Any thoughts?
enas
Hmm, this could be easily achieved with a normal bundle command. This command would simply save the current doc "foo.c" as "foo.c.1". If you invoke it again then "foo.c.2" etc. If you want to revert write another command which lets you choose a state of your doc. Furthermore a diff could also be applied quite easily. Saying thus I think there's no need to code something inside of TM.
Regards, --Hans
On 3 Oct 2012, at 13:32, Hans-Jörg Bibiko wrote:
Hmm, this could be easily achieved with a normal bundle command. This command would simply save the current doc "foo.c" as "foo.c.1". If you invoke it again then "foo.c.2" etc. If you want to revert write another command which lets you choose a state of your doc. Furthermore a diff could also be applied quite easily.
Thanks, this is a good suggestion actually, which I might even end up adopting.
The main difference with what I was proposing though is that it lacks the integration with the undo history. In my scenario, I not only want to retrieve my file in its previous state, but also have my undo history at the corresponding level. So I'm really looking for a shortcut to "undo n times", with the correct n. This can be useful for a few reasons, such as being able to hit a few redos after reverting if necessary.
That being said, there might be a way to obtain this functionality without coding inside TextMate. Any suggestions?
Regards,
enas