Insert mode line break bug fix

This commit is contained in:
2016-03-20 07:52:44 +08:00
parent dc63a882e3
commit 8769e69f35
6 changed files with 102 additions and 89 deletions

View File

@@ -36,13 +36,21 @@
INSERT.prototype.__saveCur = function()
{
var c = this.__cursor;
return {
var obj = {
p: c.P
, x: c.X
, y: c.Y
, px: c.feeder.panX
, py: c.feeder.panY
};
if( 0 < obj.x )
{
obj.p -= 1;
obj.x -= 1;
}
return obj;
}
INSERT.prototype.dispose = function()
@@ -186,20 +194,23 @@
+ inputChar
+ feeder.content.substring( f );
feeder.pan();
feeder.dispatcher.dispatchEvent( new BotanEvent( "VisualUpdate" ) );
this.__rec( inputChar );
if( inputChar == "\n" )
{
feeder.softReset();
feeder.pan();
cur.moveY( 1 );
cur.lineStart();
}
else
{
cur.moveX( 1 );
feeder.pan();
cur.moveX( 1, false, true );
}
feeder.dispatcher.dispatchEvent( new BotanEvent( "VisualUpdate" ) );
this.__rec( inputChar );
};
INSERT.prototype.getMessage = function()