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