File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/Tempest/Console/src/Components/Renderers Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,7 @@ public function render(
4343 $ lines = str ($ buffer ->text ?: ($ placeholder ?: '' ))
4444 ->explode ("\n" )
4545 ->flatMap (fn (string $ line ) => str ($ line )->chunk ($ this ->maxLineCharacters )->toArray ())
46- ->map (static fn (string $ line ) => str ($ line )->replaceEnd ("\n" , ' ' ))
47- ->filter (fn (ImmutableString $ line ) => $ line ->isNotEmpty ());
46+ ->map (static fn (string $ line ) => str ($ line )->replaceEnd ("\n" , ' ' ));
4847
4948 // calculates scroll offset based on cursor position
5049 $ this ->scrollOffset = $ this ->calculateScrollOffset ($ lines , $ this ->maximumLines , $ buffer ->getRelativeCursorPosition ($ this ->maxLineCharacters )->y );
@@ -53,7 +52,10 @@ public function render(
5352 $ displayLines = $ lines ->slice ($ this ->scrollOffset , $ this ->state ->isFinished () ? 1 : $ this ->maximumLines );
5453
5554 // if there is nothing to display after the component is done, show "no input"
56- if ($ this ->state ->isFinished () && $ lines ->isEmpty ()) {
55+ // TODO(innocenzi): clean up
56+ if ($ this ->state ->isFinished () && $ lines ->filter (fn (ImmutableString $ line ) => $ line ->trim ()->isNotEmpty ())->isEmpty ()) {
57+ $ displayLines = $ displayLines ->filter (fn (ImmutableString $ line ) => $ line ->trim ()->isNotEmpty ());
58+
5759 $ this ->line ($ this ->style ('italic dim ' , 'No input. ' ))->newLine ();
5860 }
5961
You can’t perform that action at this time.
0 commit comments