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 { impl App {
/// Constructs a new instance of `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"); event!(Level::INFO, "Rendering orig");
// lazy_render_rope_slice(chunks[0], render_states.stdout) // 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( lazy_render_rope_slice(
f, f,
chunks[0], chunks[0],
render_states.stdin.as_ref(), render_states.stdin.as_ref(),
text_orig_rope.slice(..), text_orig_rope.slice(..),
"Output", stdin_title.as_str(),
) )
} else { } else {
f.render_widget( f.render_widget(
Paragraph::new("! No Stdin !") Paragraph::new("! No Stdin !")
.alignment(Alignment::Center) .alignment(Alignment::Center)
.block(Block::default().title("Output").borders(Borders::ALL)), .block(
chunks[0], // Layout::default() Block::default()
// .direction(Direction::Vertical) .title(stdin_title.as_str())
// .constraints( .borders(Borders::ALL),
// [ ),
// Constraint::Percentage(50), chunks[0],
// Constraint::Length(1),
// Constraint::Min(0),
// ]
// .as_ref(),
// )
// .split(chunks[0])[1],
); );
Some(RenderState { Some(RenderState {
// TODO // TODO
@ -161,7 +162,7 @@ fn lazy_render_rope_slice<'a, B: Backend>(
output: Rect, output: Rect,
previous_state: Option<&RenderState>, previous_state: Option<&RenderState>,
data: RopeSlice<'_>, data: RopeSlice<'_>,
block_title: &'static str, block_title: &str,
) -> Option<RenderState> { ) -> Option<RenderState> {
let data = data let data = data
.lines() .lines()