mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
more: fix bug not displaying next file message and not stopping at end of file
This commit is contained in:
parent
479340306e
commit
77f8201fb8
1 changed files with 2 additions and 2 deletions
|
@ -312,7 +312,7 @@ fn more(
|
||||||
pager.content_rows += 3;
|
pager.content_rows += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if pager.should_close() {
|
if pager.should_close() && next_file.is_none() {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,10 +499,10 @@ impl<'a> Pager<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn draw(&mut self, stdout: &mut std::io::Stdout, wrong_key: Option<char>) {
|
fn draw(&mut self, stdout: &mut std::io::Stdout, wrong_key: Option<char>) {
|
||||||
|
self.draw_lines(stdout);
|
||||||
let lower_mark = self
|
let lower_mark = self
|
||||||
.line_count
|
.line_count
|
||||||
.min(self.upper_mark.saturating_add(self.content_rows.into()));
|
.min(self.upper_mark.saturating_add(self.content_rows.into()));
|
||||||
self.draw_lines(stdout);
|
|
||||||
self.draw_prompt(stdout, lower_mark, wrong_key);
|
self.draw_prompt(stdout, lower_mark, wrong_key);
|
||||||
stdout.flush().unwrap();
|
stdout.flush().unwrap();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue