From 40798d18a8bafcdd53558e23a8f54d8cd6183fb8 Mon Sep 17 00:00:00 2001 From: Snehil Shah Date: Sat, 1 Jun 2024 17:21:26 +0000 Subject: [PATCH] fix: incorrect `isScrollable` constraints Signed-off-by: Snehil Shah --- lib/node_modules/@stdlib/repl/lib/output_stream.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/repl/lib/output_stream.js b/lib/node_modules/@stdlib/repl/lib/output_stream.js index 98474cad80e9..fc0ab1d4e056 100644 --- a/lib/node_modules/@stdlib/repl/lib/output_stream.js +++ b/lib/node_modules/@stdlib/repl/lib/output_stream.js @@ -271,7 +271,7 @@ setNonEnumerableReadOnly( OutputStream.prototype, '_pagerHeight', function pager if ( vh < MIN_VIEWPORT_HEIGHT ) { return -1; } - return vh - RESERVED_PAGING_ROWS; + return vh - RESERVED_PAGING_ROWS; // FIXME: reserved paging rows being a constant assumes that the input prompt spans just 1 row. This might not be the case with multi-line inputs triggering the pager as it will result in an incomplete UI with only the last line of the multi-line input visible in the pager view. }); /** @@ -285,8 +285,8 @@ setNonEnumerableReadOnly( OutputStream.prototype, '_pagerHeight', function pager * @returns {boolean} boolean indicating whether content is "scrollable" */ setNonEnumerableReadOnly( OutputStream.prototype, '_isScrollable', function isScrollable( N ) { - var h = this._pagerHeight(); - return ( h > 0 && N > h ); + var vh = this._repl.viewportHeight(); + return ( vh >= MIN_VIEWPORT_HEIGHT && N > vh - 2 ); // 2 rows reserved for the input and the next prompt }); /**