aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/panes
diff options
context:
space:
mode:
authorBrooks J Rady <b.j.rady@gmail.com>2021-04-13 18:14:13 +0100
committerBrooks J Rady <b.j.rady@gmail.com>2021-04-13 18:14:13 +0100
commit6f4dcfbf65f522b318ebd359df5658a72b618392 (patch)
treed4b1591be1139a4b67d3d4f0b340a133a27ba189 /src/client/panes
parentfix(ci): unbreak things (diff)
downloadsl0ppij-6f4dcfbf65f522b318ebd359df5658a72b618392.tar.gz
sl0ppij-6f4dcfbf65f522b318ebd359df5658a72b618392.tar.xz
sl0ppij-6f4dcfbf65f522b318ebd359df5658a72b618392.zip
fix(clippy): get ci passing again
Diffstat (limited to 'src/client/panes')
-rw-r--r--src/client/panes/grid.rs10
-rw-r--r--src/client/panes/plugin_pane.rs2
-rw-r--r--src/client/panes/terminal_character.rs4
-rw-r--r--src/client/panes/terminal_pane.rs8
4 files changed, 5 insertions, 19 deletions
diff --git a/src/client/panes/grid.rs b/src/client/panes/grid.rs
index 7651bdc0..87df3023 100644
--- a/src/client/panes/grid.rs
+++ b/src/client/panes/grid.rs
@@ -29,11 +29,9 @@ fn get_top_non_canonical_rows(rows: &mut Vec<Row>) -> Vec<Row> {
fn get_bottom_canonical_row_and_wraps(rows: &mut Vec<Row>) -> Vec<Row> {
let mut index_of_last_non_canonical_row = None;
for (i, row) in rows.iter().enumerate().rev() {
+ index_of_last_non_canonical_row = Some(i);
if row.is_canonical {
- index_of_last_non_canonical_row = Some(i);
break;
- } else {
- index_of_last_non_canonical_row = Some(i);
}
}
match index_of_last_non_canonical_row {
@@ -496,9 +494,7 @@ impl Grid {
}
pub fn add_character(&mut self, terminal_character: TerminalCharacter) {
// TODO: try to separate adding characters from moving the cursors in this function
- if self.cursor.x < self.width {
- self.insert_character_at_cursor_position(terminal_character);
- } else {
+ if self.cursor.x >= self.width {
// line wrap
self.cursor.x = 0;
if self.cursor.y == self.height - 1 {
@@ -519,8 +515,8 @@ impl Grid {
self.viewport.push(line_wrapped_row);
}
}
- self.insert_character_at_cursor_position(terminal_character);
}
+ self.insert_character_at_cursor_position(terminal_character);
self.move_cursor_forward_until_edge(1);
}
pub fn move_cursor_forward_until_edge(&mut self, count: usize) {
diff --git a/src/client/panes/plugin_pane.rs b/src/client/panes/plugin_pane.rs
index 49cf2aee..24daec08 100644
--- a/src/client/panes/plugin_pane.rs
+++ b/src/client/panes/plugin_pane.rs
@@ -1,5 +1,3 @@
-#![allow(clippy::clippy::if_same_then_else)]
-
use crate::{common::SenderWithContext, pty_bus::VteBytes, tab::Pane, wasm_vm::PluginInstruction};
use std::{sync::mpsc::channel, unimplemented};
diff --git a/src/client/panes/terminal_character.rs b/src/client/panes/terminal_character.rs
index ce967ef8..7569e993 100644
--- a/src/client/panes/terminal_character.rs
+++ b/src/client/panes/terminal_character.rs
@@ -48,7 +48,7 @@ pub enum NamedColor {
}
impl NamedColor {
- fn to_foreground_ansi_code(&self) -> String {
+ fn to_foreground_ansi_code(self) -> String {
match self {
NamedColor::Black => format!("{}", 30),
NamedColor::Red => format!("{}", 31),
@@ -68,7 +68,7 @@ impl NamedColor {
NamedColor::BrightWhite => format!("{}", 97),
}
}
- fn to_background_ansi_code(&self) -> String {
+ fn to_background_ansi_code(self) -> String {
match self {
NamedColor::Black => format!("{}", 40),
NamedColor::Red => format!("{}", 41),
diff --git a/src/client/panes/terminal_pane.rs b/src/client/panes/terminal_pane.rs
index d2473ba3..fd9bbb07 100644
--- a/src/client/panes/terminal_pane.rs
+++ b/src/client/panes/terminal_pane.rs
@@ -1,5 +1,3 @@
-#![allow(clippy::clippy::if_same_then_else)]
-
use crate::tab::Pane;
use ::nix::pty::Winsize;
use ::std::os::unix::io::RawFd;
@@ -566,12 +564,6 @@ impl vte::Perform for TerminalPane {
} else {
self.grid.clear_scroll_region();
}
- } else if c == 't' {
- // TBD - title?
- } else if c == 'n' {
- // TBD - device status report
- } else if c == 'c' {
- // TBD - identify terminal
} else if c == 'M' {
// delete lines if currently inside scroll region
let line_count_to_delete = if params[0] == 0 {