This commit is contained in:
2026-01-24 02:16:18 +01:00
parent 04f5e19ab2
commit 6f5fa762a4
6 changed files with 84 additions and 29 deletions

View File

@@ -498,10 +498,10 @@ fn render_modal(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, term
let height = (term.height * 60 / 100).max(10);
let step_num = app.editor_ctx.step + 1;
let border_color = if app.ui.is_flashing() {
Color::Green
} else {
Color::Rgb(100, 160, 180)
let flash_color = app.ui.flash_color();
let border_color = match flash_color {
Some(c) => c,
None => Color::Rgb(100, 160, 180),
};
let inner = ModalFrame::new(&format!("Step {step_num:02} Script"))
@@ -537,7 +537,34 @@ fn render_modal(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, term
highlight::highlight_line_with_runtime(line, &exec, &sel)
};
app.editor_ctx.editor.render(frame, inner, &highlighter);
let editor_area = Rect::new(inner.x, inner.y, inner.width, inner.height.saturating_sub(1));
let hint_area = Rect::new(inner.x, inner.y + editor_area.height, inner.width, 1);
if let Some(c) = flash_color {
let bg = match c {
Color::Red => Color::Rgb(60, 10, 10),
Color::White => Color::Rgb(30, 30, 40),
_ => Color::Rgb(10, 30, 10),
};
let flash_block = Block::default().style(Style::default().bg(bg));
frame.render_widget(flash_block, editor_area);
}
app.editor_ctx.editor.render(frame, editor_area, &highlighter);
let dim = Style::default().fg(Color::DarkGray);
let key = Style::default().fg(Color::Yellow);
let hint = Line::from(vec![
Span::styled("Esc", key), Span::styled(" save ", dim),
Span::styled("C-e", key), Span::styled(" eval ", dim),
Span::styled("C-u", key), Span::styled("/", dim),
Span::styled("C-r", key), Span::styled(" undo/redo ", dim),
Span::styled("C-j", key), Span::styled("/", dim),
Span::styled("C-k", key), Span::styled(" del-bol/eol ", dim),
Span::styled("C-x", key), Span::styled("/", dim),
Span::styled("C-c", key), Span::styled("/", dim),
Span::styled("C-y", key), Span::styled(" cut/copy/paste ", dim),
]);
frame.render_widget(Paragraph::new(hint).alignment(Alignment::Right), hint_area);
}
}
}