Store the stacks indefinitely

This commit is contained in:
斟酌 鵬兄 2016-03-17 07:16:06 +08:00
parent 865530709b
commit 44fec5abfd
2 changed files with 9 additions and 6 deletions

View File

@ -4,7 +4,9 @@
var Recorder = function()
{
this.__steps = [];
this.__stacks = [];
this.__i = 0;
this.__j = 0;
};
Recorder.prototype.undo = function()
@ -31,8 +33,12 @@
Recorder.prototype.record = function( StateObj )
{
this.__steps[ this.__i ] = StateObj;
StateObj.id = this.__i ++;
this.__steps[ this.__i ++ ] = StateObj;
this.__stacks[ this.__j ++ ] = StateObj;
delete this.__steps[ this.__i ];
StateObj.id = this.__j;
};
ns[ NS_EXPORT ]( EX_CLASS, "Recorder", Recorder );

View File

@ -4,10 +4,7 @@
/** @type {Components.Vim.DateTime} */
var RelativeTime = __import( "Components.Vim.DateTime.RelativeTime" );
var Stack = function()
{
};
var Stack = function() { };
Stack.prototype.store = function( handler )
{