calculate document position

This commit is contained in:
斟酌 鵬兄 2016-04-01 05:22:02 +08:00
parent 62d2de3800
commit ddc7058964
3 changed files with 14 additions and 7 deletions

View File

@ -16,7 +16,6 @@
{
this.__reset( Cursor );
this.__msg = Mesg( "VISUAL" );
this.__leaveMesg = "";
Cursor.blink = false;
Cursor.pSpace = true;
@ -35,7 +34,6 @@
VISUAL.prototype.dispose = function()
{
this.__msg = this.__leaveMesg;
var c = this.__cursor;
c.blink = true;
@ -45,10 +43,12 @@
// This fix the highlighting position of missing phantomSpace
// for maximum filled line
if( c.feeder.wrap )
if( c.feeder.wrap && 0 < c.X )
{
c.suppressEvent();
c.moveX( -1 );
c.moveX( 1 );
c.unsuppressEvent();
}
};
@ -92,7 +92,7 @@
cur.moveTo( this.__startaP );
}
this.__leaveMesg = Action.getMessage();
this.__msg = Action.getMessage();
Action.dispose();
cur.unsuppressEvent();

View File

@ -387,7 +387,7 @@
this.__pulseMsg = this.action.getMessage();
this.action = null;
debug.Info( "closeAction" );
debug.Info( "closeAction: " + this.__pulseMsg );
// Reset the analyzed content
this.Vim.contentAnalyzer.reset();

View File

@ -226,9 +226,16 @@
__readOnly( Feeder.prototype, "docPos", function() {
var pos = "ALL";
if( 0 < this.panY && this.EOF )
if( 0 < this.panY )
{
pos = "BOTTOM";
if( this.EOF )
{
pos = "BOTTOM";
}
else
{
pos = Math.floor( ( this.panY / ( this.linesTotal - ( this.__rows - 1 ) ) ) * 100 ) + "%";
}
}
else
{