File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -373,16 +373,25 @@ function showMessagesScroller(msg, persist) {
373
373
//print(shownIdxFirst, shownIdxLast)
374
374
375
375
for ( let i = 0 ; i < firstTitleLinePerMsg . length - 1 ; i ++ ) {
376
-
377
- if ( shownScrollIdxFirst <= firstTitleLinePerMsg [ i ] && shownScrollIdxFirst + LINES_PER_SCREEN > firstTitleLinePerMsg [ i ] ) {
376
+ const FIRST_LINE_OF_MSG = firstTitleLinePerMsg [ i ] ;
377
+ const LAST_LINE_OF_MSG = firstTitleLinePerMsg [ i + 1 ] - 1 ;
378
+
379
+ if (
380
+ shownScrollIdxFirst
381
+ <= FIRST_LINE_OF_MSG && FIRST_LINE_OF_MSG
382
+ < shownScrollIdxFirst + LINES_PER_SCREEN
383
+ ) {
378
384
shownMsgIdxFirst = i ;
379
385
}
380
386
381
- if ( shownScrollIdxLast >= firstTitleLinePerMsg [ i + 1 ] && shownScrollIdxLast - LINES_PER_SCREEN < firstTitleLinePerMsg [ i + 1 ] ) {
387
+ if (
388
+ shownScrollIdxLast - LINES_PER_SCREEN
389
+ < LAST_LINE_OF_MSG && LAST_LINE_OF_MSG
390
+ <= shownScrollIdxLast
391
+ ) {
382
392
shownMsgIdxLast = i ;
383
393
//print(i)
384
394
}
385
-
386
395
}
387
396
if ( shownScrollIdxLast === allLines . length - 1 ) { shownMsgIdxLast = MESSAGES . length - 1 ; }
388
397
You can’t perform that action at this time.
0 commit comments