File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -103,10 +103,10 @@ class MainPanel extends BaseWidget {
103
103
} ) ) ;
104
104
}
105
105
106
- renderLines ( ) {
106
+ renderLines ( notify = true ) {
107
107
this . resetMode ( ) ;
108
108
this . rows = this . lines . slice ( this . initialRow , this . initialRow + this . height - 2 ) ;
109
- this . update ( ) ;
109
+ this . update ( notify ) ;
110
110
}
111
111
112
112
handleKeyPress ( ch , key ) {
@@ -428,18 +428,20 @@ class MainPanel extends BaseWidget {
428
428
429
429
moveUp ( ) {
430
430
this . row = Math . max ( 0 , this . row - 1 ) ;
431
- if ( this . row < this . initialRow ) {
431
+ const outside = this . row < this . initialRow ;
432
+ if ( outside ) {
432
433
this . initialRow = this . row ;
433
434
}
434
- this . renderLines ( ) ;
435
+ this . renderLines ( outside ) ;
435
436
}
436
437
437
438
moveDown ( ) {
438
439
this . row = Math . min ( this . lastRow , this . row + 1 ) ;
439
- if ( this . row > this . lastVisibleLine ) {
440
+ const outside = this . row > this . lastVisibleLine ;
441
+ if ( outside ) {
440
442
this . initialRow += 1 ;
441
443
}
442
- this . renderLines ( ) ;
444
+ this . renderLines ( outside ) ;
443
445
}
444
446
445
447
firstPage ( ) {
@@ -484,7 +486,7 @@ class MainPanel extends BaseWidget {
484
486
return this . initialRow + this . pageHeight ;
485
487
}
486
488
487
- update ( ) {
489
+ update ( notify = true ) {
488
490
this . setLabel ( `[{bold} ${ this . file } {/}] [{bold} ${ this . row + 1 } /${ this . lastRow + 1 } {/}]` ) ;
489
491
490
492
const columns = [
@@ -507,7 +509,9 @@ class MainPanel extends BaseWidget {
507
509
const list = blessed . element ( { tags : true , content } ) ;
508
510
this . append ( list ) ;
509
511
this . screen . render ( ) ;
510
- this . setUpdated ( ) ;
512
+ if ( notify ) {
513
+ this . setUpdated ( ) ;
514
+ }
511
515
}
512
516
}
513
517
You can’t perform that action at this time.
0 commit comments