Reset analyzed content when needed

This commit is contained in:
斟酌 鵬兄 2016-03-31 03:12:18 +08:00
parent 1bc1a90b31
commit 79705e9b14
3 changed files with 17 additions and 5 deletions

View File

@ -191,10 +191,10 @@
this.PEnd = P + 1; this.PEnd = P + 1;
this.__p = P; this.__p = P;
this.__fireUpdate(); this.__visualUpdate();
}; };
Cursor.prototype.__fireUpdate = function() Cursor.prototype.__visualUpdate = function()
{ {
if( 0 < this.__suppEvt ) if( 0 < this.__suppEvt )
{ {
@ -313,7 +313,7 @@
this.action = new (Actions[ name ])( this ); this.action = new (Actions[ name ])( this );
this.__pulseMsg = null; this.__pulseMsg = null;
this.__fireUpdate(); this.__visualUpdate();
}; };
Cursor.prototype.closeAction = function() Cursor.prototype.closeAction = function()
@ -323,7 +323,10 @@
this.__pulseMsg = this.action.getMessage(); this.__pulseMsg = this.action.getMessage();
this.action = null; this.action = null;
this.__fireUpdate(); // Reset the analyzed content
this.Vim.contentAnalyzer.reset();
this.__visualUpdate();
}; };
// Open, Run, then close an action // Open, Run, then close an action
@ -335,7 +338,9 @@
this.__pulseMsg = action.getMessage(); this.__pulseMsg = action.getMessage();
action.dispose(); action.dispose();
this.__fireUpdate(); this.Vim.contentAnalyzer.reset();
this.__visualUpdate();
}; };
Cursor.prototype.suppressEvent = function() { ++ this.__suppEvt; }; Cursor.prototype.suppressEvent = function() { ++ this.__suppEvt; };

View File

@ -277,6 +277,11 @@
return pairs; return pairs;
}; };
Analyzer.prototype.reset = function()
{
this.__tokpairs = {};
};
Analyzer.prototype.quoteAt = function( p ) Analyzer.prototype.quoteAt = function( p )
{ {
var c = this.__feeder.content; var c = this.__feeder.content;

View File

@ -9,3 +9,5 @@ Components.Vim.Syntax.Analyzer.bracketIn;
Components.Vim.Syntax.Analyzer.wordAt; Components.Vim.Syntax.Analyzer.wordAt;
/** @type Function */ /** @type Function */
Components.Vim.Syntax.Analyzer.quoteAt; Components.Vim.Syntax.Analyzer.quoteAt;
/** @type Function */
Components.Vim.Syntax.Analyzer.reset;