cli: Use new pager for `rad diff`

This commit is contained in:
cloudhead 2024-05-03 13:21:23 +02:00
parent 40f4383bbc
commit 6dd52c94fb
No known key found for this signature in database
3 changed files with 3 additions and 4 deletions

View File

@ -8,7 +8,6 @@ use radicle_surf as surf;
use crate::git::pretty_diff::ToPretty as _; use crate::git::pretty_diff::ToPretty as _;
use crate::git::Rev; use crate::git::Rev;
use crate::pager;
use crate::terminal as term; use crate::terminal as term;
use crate::terminal::args::{Args, Error, Help}; use crate::terminal::args::{Args, Error, Help};
use crate::terminal::highlight::Highlighter; use crate::terminal::highlight::Highlighter;
@ -145,7 +144,7 @@ pub fn run(options: Options, _ctx: impl term::Context) -> anyhow::Result<()> {
let mut hi = Highlighter::default(); let mut hi = Highlighter::default();
let pretty = diff.pretty(&mut hi, &(), &repo); let pretty = diff.pretty(&mut hi, &(), &repo);
pager::run(pretty)?; term::pager::page(pretty)?;
Ok(()) Ok(())
} }

View File

@ -64,7 +64,7 @@ impl Constraint {
} }
/// A text element that has a size and can be rendered to the terminal. /// A text element that has a size and can be rendered to the terminal.
pub trait Element: fmt::Debug { pub trait Element: fmt::Debug + Send + Sync {
/// Get the size of the element, in rows and columns. /// Get the size of the element, in rows and columns.
fn size(&self, parent: Constraint) -> Size; fn size(&self, parent: Constraint) -> Size;

View File

@ -78,7 +78,7 @@ impl<const W: usize, T> Default for Table<W, T> {
} }
} }
impl<const W: usize, T: Cell + fmt::Debug> Element for Table<W, T> impl<const W: usize, T: Cell + fmt::Debug + Send + Sync> Element for Table<W, T>
where where
T::Padded: Into<Line>, T::Padded: Into<Line>,
{ {