Show off combined command
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Austen Adler 2022-12-28 14:12:24 -05:00
parent 9f7fea0cfa
commit 6e258ad2a4
2 changed files with 16 additions and 16 deletions

View File

@ -131,7 +131,6 @@ impl CommandOptions {
}
}
// impl App<'_> {
impl App {
/// Constructs a new instance of `App`
///

View File

@ -32,30 +32,31 @@ pub fn draw<B: Backend>(f: &mut Frame<B>, app: &App) {
event!(Level::INFO, "Rendering orig");
// lazy_render_rope_slice(chunks[0], render_states.stdout)
render_states.stdout = if let Some(text_orig_rope) = app.text_orig_rope.as_ref() {
let stdin_title = if command_options.combined_command.is_empty() {
String::from("Input")
} else {
format!("Input ({})", command_options.combined_command)
};
render_states.stdin = if let Some(text_orig_rope) = app.text_orig_rope.as_ref() {
lazy_render_rope_slice(
f,
chunks[0],
render_states.stdin.as_ref(),
text_orig_rope.slice(..),
"Output",
stdin_title.as_str(),
)
} else {
f.render_widget(
Paragraph::new("! No Stdin !")
.alignment(Alignment::Center)
.block(Block::default().title("Output").borders(Borders::ALL)),
chunks[0], // Layout::default()
// .direction(Direction::Vertical)
// .constraints(
// [
// Constraint::Percentage(50),
// Constraint::Length(1),
// Constraint::Min(0),
// ]
// .as_ref(),
// )
// .split(chunks[0])[1],
.block(
Block::default()
.title(stdin_title.as_str())
.borders(Borders::ALL),
),
chunks[0],
);
Some(RenderState {
// TODO
@ -161,7 +162,7 @@ fn lazy_render_rope_slice<'a, B: Backend>(
output: Rect,
previous_state: Option<&RenderState>,
data: RopeSlice<'_>,
block_title: &'static str,
block_title: &str,
) -> Option<RenderState> {
let data = data
.lines()