chore: Upgrade to Ratatui v0.30.0
Test Coverage / coverage (push) Has been cancelled
Rust / rustfmt (push) Has been cancelled
Rust / clippy (beta) (push) Has been cancelled
Rust / clippy (nightly) (push) Has been cancelled
Rust / clippy (stable) (push) Has been cancelled
Rust / features (macos-latest, beta) (push) Has been cancelled
Rust / features (macos-latest, stable) (push) Has been cancelled
Rust / features (ubuntu-latest, beta) (push) Has been cancelled
Rust / features (ubuntu-latest, stable) (push) Has been cancelled
Rust / features (windows-latest, beta) (push) Has been cancelled
Rust / features (windows-latest, stable) (push) Has been cancelled
Rust / test (macos-latest, beta) (push) Has been cancelled
Rust / test (macos-latest, nightly) (push) Has been cancelled
Rust / test (macos-latest, stable) (push) Has been cancelled
Rust / test (ubuntu-latest, beta) (push) Has been cancelled
Rust / test (ubuntu-latest, nightly) (push) Has been cancelled
Rust / test (ubuntu-latest, stable) (push) Has been cancelled
Rust / test (windows-latest, beta) (push) Has been cancelled
Rust / test (windows-latest, nightly) (push) Has been cancelled
Rust / test (windows-latest, stable) (push) Has been cancelled
Rust / Release aarch64-apple-darwin (push) Has been cancelled
Rust / Release x86_64-apple-darwin (push) Has been cancelled
Rust / Release aarch64-unknown-linux-gnu (push) Has been cancelled
Rust / Release arm-unknown-linux-gnueabihf (push) Has been cancelled
Rust / Release armv7-unknown-linux-gnueabihf (push) Has been cancelled
Rust / Release riscv64gc-unknown-linux-gnu (push) Has been cancelled
Rust / Release x86_64-unknown-linux-gnu (push) Has been cancelled
Rust / Release aarch64-pc-windows-msvc (push) Has been cancelled
Rust / Release x86_64-pc-windows-msvc (push) Has been cancelled
Test Coverage / coverage (push) Has been cancelled
Rust / rustfmt (push) Has been cancelled
Rust / clippy (beta) (push) Has been cancelled
Rust / clippy (nightly) (push) Has been cancelled
Rust / clippy (stable) (push) Has been cancelled
Rust / features (macos-latest, beta) (push) Has been cancelled
Rust / features (macos-latest, stable) (push) Has been cancelled
Rust / features (ubuntu-latest, beta) (push) Has been cancelled
Rust / features (ubuntu-latest, stable) (push) Has been cancelled
Rust / features (windows-latest, beta) (push) Has been cancelled
Rust / features (windows-latest, stable) (push) Has been cancelled
Rust / test (macos-latest, beta) (push) Has been cancelled
Rust / test (macos-latest, nightly) (push) Has been cancelled
Rust / test (macos-latest, stable) (push) Has been cancelled
Rust / test (ubuntu-latest, beta) (push) Has been cancelled
Rust / test (ubuntu-latest, nightly) (push) Has been cancelled
Rust / test (ubuntu-latest, stable) (push) Has been cancelled
Rust / test (windows-latest, beta) (push) Has been cancelled
Rust / test (windows-latest, nightly) (push) Has been cancelled
Rust / test (windows-latest, stable) (push) Has been cancelled
Rust / Release aarch64-apple-darwin (push) Has been cancelled
Rust / Release x86_64-apple-darwin (push) Has been cancelled
Rust / Release aarch64-unknown-linux-gnu (push) Has been cancelled
Rust / Release arm-unknown-linux-gnueabihf (push) Has been cancelled
Rust / Release armv7-unknown-linux-gnueabihf (push) Has been cancelled
Rust / Release riscv64gc-unknown-linux-gnu (push) Has been cancelled
Rust / Release x86_64-unknown-linux-gnu (push) Has been cancelled
Rust / Release aarch64-pc-windows-msvc (push) Has been cancelled
Rust / Release x86_64-pc-windows-msvc (push) Has been cancelled
This commit is contained in:
+6
-3
@@ -7,7 +7,7 @@ use ratatui::layout::{Position, Rect};
|
||||
use ratatui::style::{Color, Modifier, Style};
|
||||
use ratatui::text::Span;
|
||||
use ratatui::widgets::{Block, Scrollbar, ScrollbarOrientation};
|
||||
use ratatui::{crossterm, Frame, Terminal};
|
||||
use ratatui::{Frame, Terminal, crossterm};
|
||||
|
||||
#[must_use]
|
||||
struct App {
|
||||
@@ -129,7 +129,10 @@ fn main() -> std::io::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn run_app<B: Backend>(terminal: &mut Terminal<B>, mut app: App) -> std::io::Result<()> {
|
||||
fn run_app<B: Backend<Error = std::io::Error>>(
|
||||
terminal: &mut Terminal<B>,
|
||||
mut app: App,
|
||||
) -> std::io::Result<()> {
|
||||
const DEBOUNCE: Duration = Duration::from_millis(20); // 50 FPS
|
||||
|
||||
let before = Instant::now();
|
||||
@@ -144,7 +147,7 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, mut app: App) -> std::io::Res
|
||||
let update = match crossterm::event::read()? {
|
||||
Event::Key(key) => match key.code {
|
||||
KeyCode::Char('c') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
KeyCode::Char('q') => return Ok(()),
|
||||
KeyCode::Char('\n' | ' ') => app.state.toggle_selected(),
|
||||
|
||||
Reference in New Issue
Block a user