fix(clippy): unneccessary `>= y + 1` or `x - 1 >=`
-//! `Tab`s holds multiple panes. It tracks their coordinates (x/y) and size, as well as how they should be resized
+//! `Tab`s holds multiple panes. It tracks their coordinates (x/y) and size,
+//! as well as how they should be resized
use crate::common::{AppInstruction, SenderWithContext};
use crate::panes::{PaneId, PositionAndSize, TerminalPane};
@@ -296,9 +297,8 @@ impl Tab {
* terminal_to_check.columns();
let terminal_can_be_split = terminal_to_check.columns() >= MIN_TERMINAL_WIDTH
&& terminal_to_check.rows() >= MIN_TERMINAL_HEIGHT
- && ((terminal_to_check.columns() >= terminal_to_check.min_width() * 2 + 1)
- || (terminal_to_check.rows()
- >= terminal_to_check.min_height() * 2 + 1));
+ && ((terminal_to_check.columns() > terminal_to_check.min_width() * 2)
+ || (terminal_to_check.rows() > terminal_to_check.min_height() * 2));
if terminal_can_be_split && terminal_size > current_largest_terminal_size {
(terminal_size, Some(*id_of_terminal_to_check))
} else {
@@ -321,7 +321,7 @@ impl Tab {
y: terminal_to_split.y(),
};
if terminal_to_split.rows() * CURSOR_HEIGHT_WIDTH_RATIO > terminal_to_split.columns()
- && terminal_to_split.rows() >= terminal_to_split.min_height() * 2 + 1
+ && terminal_to_split.rows() > terminal_to_split.min_height() * 2
{
// FIXME: This could use a second look
if let PaneId::Terminal(term_pid) = pid {
@@ -343,7 +343,7 @@ impl Tab {
}
self.active_terminal = Some(pid);
}
- } else if terminal_to_split.columns() >= terminal_to_split.min_width() * 2 + 1 {
+ } else if terminal_to_split.columns() > terminal_to_split.min_width() * 2 {
// FIXME: This could use a second look
if let PaneId::Terminal(term_pid) = pid {
let (left_winsize, right_winsize) = split_vertically_with_gap(&terminal_ws);
