diff options
author | qkzk <qu3nt1n@gmail.com> | 2024-01-25 14:38:33 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2024-01-25 14:38:33 +0100 |
commit | 2857628639ab53152fa9723be9086f93c6b26d05 (patch) | |
tree | fc3f6e3e45c913818d81862c90d86396dff72439 | |
parent | c4eae466c106d19118401076ad25d6aee8fbb509 (diff) |
FIX win second use 1 more line
-rw-r--r-- | development.md | 1 | ||||
-rw-r--r-- | src/io/display.rs | 8 | ||||
-rw-r--r-- | src/modes/display/content_window.rs | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/development.md b/development.md index 52e5d1f..c9b36a2 100644 --- a/development.md +++ b/development.md @@ -918,6 +918,7 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally. - [x] allow different ports in remote - [x] sort trash by reversed deletion date - [x] gradient over listing +- [x] FIX win second use 1 more line - [ ] ??? ## TODO diff --git a/src/io/display.rs b/src/io/display.rs index e5beea3..f2a92bf 100644 --- a/src/io/display.rs +++ b/src/io/display.rs @@ -720,10 +720,10 @@ impl<'a> Draw for WinSecondary<'a> { _ => return Ok(()), }?; self.draw_cursor(canvas)?; + WinSecondaryFirstLine::new(self.status).draw(canvas)?; self.draw_second_line(canvas)?; self.draw_binds_per_mode(canvas, self.tab.edit_mode)?; - - WinSecondaryFirstLine::new(self.status).draw(canvas) + Ok(()) } } @@ -762,8 +762,10 @@ impl<'a> WinSecondary<'a> { } fn draw_binds_per_mode(&self, canvas: &mut dyn Canvas, mode: Edit) -> Result<()> { + let (width, height) = canvas.size()?; + canvas.print(height - 1, 0, &" ".repeat(width))?; canvas.print_with_attr( - canvas.height()? - 1, + height - 1, 2, crate::modes::binds_per_mode(mode), color_to_attr(MENU_COLORS.second), diff --git a/src/modes/display/content_window.rs b/src/modes/display/content_window.rs index 97d6f04..4e1603c 100644 --- a/src/modes/display/content_window.rs +++ b/src/modes/display/content_window.rs @@ -41,7 +41,7 @@ impl ContentWindow { /// Default value for the bottom index. /// minimum of terminal height minus reserved rows and the length of the content. fn default_bottom(len: usize, height: usize) -> usize { - min(height - Self::BOTTOM_ROWS, len) + min(height.saturating_sub(Self::BOTTOM_ROWS), len) } /// Returns a new `ContentWindow` instance with values depending of |