From 6dd52c94fb1472e251110e439fe656aaed74019f Mon Sep 17 00:00:00 2001 From: cloudhead Date: Fri, 3 May 2024 13:21:23 +0200 Subject: [PATCH] cli: Use new pager for `rad diff` --- radicle-cli/src/commands/diff.rs | 3 +-- radicle-term/src/element.rs | 2 +- radicle-term/src/table.rs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/radicle-cli/src/commands/diff.rs b/radicle-cli/src/commands/diff.rs index 43c9246d..1eef5cb4 100644 --- a/radicle-cli/src/commands/diff.rs +++ b/radicle-cli/src/commands/diff.rs @@ -8,7 +8,6 @@ use radicle_surf as surf; use crate::git::pretty_diff::ToPretty as _; use crate::git::Rev; -use crate::pager; use crate::terminal as term; use crate::terminal::args::{Args, Error, Help}; 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 pretty = diff.pretty(&mut hi, &(), &repo); - pager::run(pretty)?; + term::pager::page(pretty)?; Ok(()) } diff --git a/radicle-term/src/element.rs b/radicle-term/src/element.rs index 9432b4d9..7d87d2d3 100644 --- a/radicle-term/src/element.rs +++ b/radicle-term/src/element.rs @@ -64,7 +64,7 @@ impl Constraint { } /// 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. fn size(&self, parent: Constraint) -> Size; diff --git a/radicle-term/src/table.rs b/radicle-term/src/table.rs index a4137682..ef992480 100644 --- a/radicle-term/src/table.rs +++ b/radicle-term/src/table.rs @@ -78,7 +78,7 @@ impl Default for Table { } } -impl Element for Table +impl Element for Table where T::Padded: Into, {