forked from Botanical/BotanJS
Bug fix for Ctrl + b/f
This commit is contained in:
parent
27ce6b3e50
commit
8c5f50ec2c
@ -270,14 +270,16 @@
|
||||
case J: this.__cMoveY( 1 ); break; // Down
|
||||
|
||||
case CTRL + F: // Page Down
|
||||
if( cfeeder.firstBuffer.next.placeholder )
|
||||
if( cfeeder.firstBuffer.nextLine.placeholder )
|
||||
{
|
||||
beep();
|
||||
break;
|
||||
}
|
||||
|
||||
var oPan = cfeeder.panY;
|
||||
cfeeder.pan( undefined, vima.rows - 1 );
|
||||
cfeeder.pan( undefined, cfeeder.moreAt );
|
||||
cfeeder.softReset();
|
||||
|
||||
ccur.moveY( -ccur.Y );
|
||||
|
||||
break;
|
||||
@ -287,7 +289,9 @@
|
||||
beep();
|
||||
break;
|
||||
}
|
||||
cfeeder.pan( undefined, -vima.rows + 1 );
|
||||
cfeeder.pan( undefined, -cfeeder.moreAt );
|
||||
cfeeder.softReset();
|
||||
|
||||
ccur.moveY( -ccur.Y );
|
||||
if( !cfeeder.EOF ) ccur.moveY( cfeeder.moreAt );
|
||||
break;
|
||||
|
@ -141,17 +141,17 @@
|
||||
// Y cannot be negative
|
||||
if( Y < 0 ) Y = 0;
|
||||
|
||||
// Compensate the last "\n" content placeholder
|
||||
var cont = this.content.slice( 0, -1 );
|
||||
if( 0 < Y )
|
||||
{
|
||||
f = this.content.indexOf( "\n" );
|
||||
f = cont.indexOf( "\n" );
|
||||
for( i = 1; f != -1 && i < Y; i ++ )
|
||||
{
|
||||
var a = this.content.indexOf( "\n", f + 1 );
|
||||
var a = cont.indexOf( "\n", f + 1 );
|
||||
if( a == -1 )
|
||||
{
|
||||
Y = i - 1;
|
||||
// -2 to compensate the last "\n" content placeholder
|
||||
f -= 2;
|
||||
Y = i;
|
||||
break;
|
||||
}
|
||||
f = a;
|
||||
|
@ -104,7 +104,7 @@
|
||||
cfeeder.init( content + "\n" );
|
||||
|
||||
// Status can consumes up to full screen, I think
|
||||
sfeeder = new LineFeeder( r, c );
|
||||
var sfeeder = new LineFeeder( r, c );
|
||||
sfeeder.setRender( false );
|
||||
|
||||
// Set the Vim instance
|
||||
|
Loading…
Reference in New Issue
Block a user