forked from Botanical/BotanJS
minor bug fixes
This commit is contained in:
parent
11dbf01ddf
commit
3ed8135791
@ -45,6 +45,13 @@
|
||||
var cur = this.__cursor;
|
||||
var feeder = cur.feeder;
|
||||
|
||||
// Do nothing if content is considered empty
|
||||
if( feeder.firstBuffer.next.placeholder && feeder.content.length < 2 )
|
||||
{
|
||||
debug.Info( "Content is empty" );
|
||||
return true;
|
||||
}
|
||||
|
||||
var Triggered = false;
|
||||
|
||||
if( sp == undefined )
|
||||
@ -134,7 +141,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
var c = feeder.content;
|
||||
// last "\n" padding
|
||||
var c = feeder.content.slice( 0, -1 );
|
||||
|
||||
var s = sp;
|
||||
var e = cur.aPos;
|
||||
@ -151,6 +159,7 @@
|
||||
this.__nline = occurence( removed, "\n" );
|
||||
|
||||
feeder.content = c.substring( 0, s ) + c.substring( e + 1 );
|
||||
if( feeder.content === "" ) feeder.content = "\n";
|
||||
|
||||
// Try to keep the original panning if possible
|
||||
feeder.pan( undefined
|
||||
|
@ -110,9 +110,7 @@
|
||||
var oY = feeder.panY + cur.Y;
|
||||
if( cur.X == 0 && feeder.panY == 0 && cur.Y == 0 ) return;
|
||||
|
||||
cur.moveX( -1, true, true );
|
||||
|
||||
var f = cur.aPos;
|
||||
var f = cur.aPos - 1;
|
||||
|
||||
if( this.__punch <= this.__minReach )
|
||||
{
|
||||
@ -123,6 +121,10 @@
|
||||
feeder.content.substring( 0, f )
|
||||
+ feeder.content.substring( f + 1 );
|
||||
|
||||
feeder.pan();
|
||||
|
||||
cur.moveX( -1, true, true );
|
||||
|
||||
if( 0 < this.__insertLen ) this.__insertLen --;
|
||||
this.__punch --;
|
||||
}
|
||||
@ -135,10 +137,11 @@
|
||||
feeder.content =
|
||||
feeder.content.substring( 0, f )
|
||||
+ feeder.content.substring( f + 1 );
|
||||
|
||||
feeder.pan();
|
||||
}
|
||||
else return;
|
||||
|
||||
feeder.pan();
|
||||
feeder.dispatcher.dispatchEvent( new BotanEvent( "VisualUpdate" ) );
|
||||
};
|
||||
|
||||
|
@ -217,7 +217,7 @@
|
||||
|
||||
if( boundary )
|
||||
{
|
||||
x = 0 < d ? lineEnd : 0;
|
||||
x = 0 < x ? lineEnd : 0;
|
||||
}
|
||||
else if( c == "\n" )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user