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