aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrooks J Rady <b.j.rady@gmail.com>2021-01-06 13:40:16 +0000
committerBrooks J Rady <b.j.rady@gmail.com>2021-01-06 13:40:16 +0000
commit931384d42fbaf81fe84d5b1072a4d24ec2fb68b9 (patch)
treee7635a095df952bfed473a911d4e91363a1c814f /src
parentVery nearly working (diff)
downloadsl0ppij-931384d42fbaf81fe84d5b1072a4d24ec2fb68b9.tar.gz
sl0ppij-931384d42fbaf81fe84d5b1072a4d24ec2fb68b9.tar.xz
sl0ppij-931384d42fbaf81fe84d5b1072a4d24ec2fb68b9.zip
Functional drawing of plugins to the screen
Diffstat (limited to 'src')
-rw-r--r--src/tab.rs9
-rw-r--r--src/terminal_pane/plugin_pane.rs6
-rw-r--r--src/terminal_pane/terminal_pane.rs1
3 files changed, 8 insertions, 8 deletions
diff --git a/src/tab.rs b/src/tab.rs
index 81ac309b..388d7144 100644
--- a/src/tab.rs
+++ b/src/tab.rs
@@ -544,17 +544,22 @@ impl Tab {
self.full_screen_ws.columns as u16,
self.full_screen_ws.rows as u16,
);
- for (_, terminal) in self.panes.iter_mut() {
+ for (kind, terminal) in self.panes.iter_mut() {
if !self.panes_to_hide.contains(&terminal.pid()) {
boundaries.add_rect(&terminal);
if let Some(vte_output) = terminal.render() {
+ let vte_output = if let PaneKind::Terminal(_) = kind {
+ vte_output
+ } else {
+ pad_to_size(&vte_output, terminal.rows(), terminal.columns())
+ };
// FIXME: Use Termion for cursor and style clearing?
write!(
stdout,
"\u{1b}[{};{}H\u{1b}[m{}",
terminal.y() + 1,
terminal.x() + 1,
- pad_to_size(&vte_output, terminal.rows(), terminal.columns())
+ vte_output
).expect("cannot write to stdout");
}
}
diff --git a/src/terminal_pane/plugin_pane.rs b/src/terminal_pane/plugin_pane.rs
index 3d525fa7..f74d5df0 100644
--- a/src/terminal_pane/plugin_pane.rs
+++ b/src/terminal_pane/plugin_pane.rs
@@ -113,11 +113,7 @@ impl Pane for PluginPane {
.unwrap();
self.should_render = false;
- let goto_plugin_coordinates = format!("\u{1b}[{};{}H", self.y() + 1, self.x() + 1); // goto row/col and reset styles
- let reset_styles = "\u{1b}[m";
- let buf = pad_to_size(&buf_rx.recv().unwrap(), self.rows(), self.columns());
- let vte_output = format!("{}{}{}", goto_plugin_coordinates, reset_styles, buf);
- Some(vte_output)
+ Some(buf_rx.recv().unwrap())
} else {
None
}
diff --git a/src/terminal_pane/terminal_pane.rs b/src/terminal_pane/terminal_pane.rs
index 096e9836..7f335d69 100644
--- a/src/terminal_pane/terminal_pane.rs
+++ b/src/terminal_pane/terminal_pane.rs
@@ -193,7 +193,6 @@ impl Pane for TerminalPane {
}
}
character_styles.clear();
- vte_output.push('\n');
}
self.mark_for_rerender();
Some(vte_output)