Rewrite moveX function

This commit is contained in:
2016-04-01 04:05:43 +08:00
parent af2da6e023
commit a927c90134
5 changed files with 101 additions and 18 deletions

View File

@@ -44,9 +44,13 @@
var feeder = cur.feeder;
var newLine = cput.newLine;
// Compensation
var c = e.kMap( "P" ) ? 0 : -1;
if( newLine )
{
cur.moveY( 1 );
cur.moveY( -c );
cur.lineStart();
}
@@ -69,7 +73,7 @@
stack.store( function()
{
f();
cur.moveY( -1 );
cur.moveY( c );
} );
}
else

View File

@@ -36,10 +36,20 @@
VISUAL.prototype.dispose = function()
{
this.__msg = this.__leaveMesg;
this.__cursor.blink = true;
this.__cursor.pSpace = false;
this.__cursor.PStart = this.__selStart;
this.__cursor.PEnd = this.__selStart + 1;
var c = this.__cursor;
c.blink = true;
c.pSpace = false;
c.PStart = this.__selStart;
c.PEnd = this.__selStart + 1;
// This fix the highlighting position of missing phantomSpace
// for maximum filled line
if( c.feeder.wrap )
{
c.moveX( -1 );
c.moveX( 1 );
}
};
VISUAL.prototype.handler = function( e, done )