From 77f8201fb8ab48e8f290c564e0c3dfe68b2a7687 Mon Sep 17 00:00:00 2001 From: Ideflop <94184575+Ideflop@users.noreply.github.com> Date: Mon, 5 Jun 2023 18:55:44 +0200 Subject: [PATCH] more: fix bug not displaying next file message and not stopping at end of file --- src/uu/more/src/more.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uu/more/src/more.rs b/src/uu/more/src/more.rs index 43c5c5163..c488ba8af 100644 --- a/src/uu/more/src/more.rs +++ b/src/uu/more/src/more.rs @@ -312,7 +312,7 @@ fn more( pager.content_rows += 3; } - if pager.should_close() { + if pager.should_close() && next_file.is_none() { return Ok(()); } @@ -499,10 +499,10 @@ impl<'a> Pager<'a> { } fn draw(&mut self, stdout: &mut std::io::Stdout, wrong_key: Option) { + self.draw_lines(stdout); let lower_mark = self .line_count .min(self.upper_mark.saturating_add(self.content_rows.into())); - self.draw_lines(stdout); self.draw_prompt(stdout, lower_mark, wrong_key); stdout.flush().unwrap(); }