Show off combined command
This commit is contained in:
parent
9f7fea0cfa
commit
6e258ad2a4
@ -131,7 +131,6 @@ impl CommandOptions {
|
||||
}
|
||||
}
|
||||
|
||||
// impl App<'_> {
|
||||
impl App {
|
||||
/// Constructs a new instance of `App`
|
||||
///
|
||||
|
31
src/ui.rs
31
src/ui.rs
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user