Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ratatui and ansi-to-tui to latest version #310

Merged
merged 1 commit into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 125 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ colored = "2.0.4"
rand = "0.8.5"
unicode-width = "0.1.11"
lazy_static = "1.4.0"
ansi-to-tui = "3.1.0"
ansi-to-tui = "4.0.1"
color-to-tui = "0.3.0"
dirs = "5.0.1"
toml = { version = "0.8.8", features = ["parse"] }
serde_json = "1.0.107"
thiserror = "1.0.49"
ratatui = { version = "0.*", default-features = false, features = ["crossterm"] }
ratatui = { version = "0.26", default-features = false, features = ["crossterm"] }
serde = { version = "1.0.188", features = ["derive"] }

[build-dependencies.vergen]
Expand Down
8 changes: 4 additions & 4 deletions src/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
use ansi_to_tui::IntoText;
use colored::Colorize;
use io::Read;
use ratatui::style::{Color, Style};
use ratatui::text::{Line, Span, Text};
use std::fs::File;
use std::io::{self, BufReader};
use std::path::Path;
use ratatui::style::{Color, Style};
use ratatui::text::{Span, Line, Text};

lazy_static! {
static ref BLUE: Style = Style::default().fg(Color::Blue);
Expand Down Expand Up @@ -75,8 +75,8 @@
let mut reader = BufReader::new(file);
let mut buffer: Vec<u8> = Vec::new();
reader.read_to_end(&mut buffer)?;
let mut text = buffer.into_text().unwrap_or_default();
text.patch_style(Style::default().fg(color));
let text = buffer.into_text().unwrap_or_default();
let text = text.patch_style(Style::default().fg(color));
Ok(text)
}

Expand Down Expand Up @@ -304,7 +304,7 @@
}

#[cfg(target_os = "freebsd")]
pub(crate) fn get_ascii_art(size: AsciiSize) -> Vec<Text<'static>> {

Check warning on line 307 in src/ascii.rs

View workflow job for this annotation

GitHub Actions / freeBSD x86_64 (x86_64-unknown-freebsd)

unused variable: `size`

Check warning on line 307 in src/ascii.rs

View workflow job for this annotation

GitHub Actions / freeBSD x86_64 (x86_64-unknown-freebsd)

unused variable: `size`
// The following ASCII art was made by Dylan Araps
// and taken from https://github.com/dylanaraps/pfetch

Expand Down
6 changes: 3 additions & 3 deletions src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use crate::data::Readout;
use crate::theme::Theme;
use crate::widgets::readout::ReadoutList;
use atty::Stream;
use std::io;
use std::io::Stdout;
use ratatui::backend::{Backend, CrosstermBackend};
use ratatui::buffer::{Buffer, Cell};
use ratatui::layout::{Margin, Rect};
use ratatui::text::Text;
use ratatui::widgets::{Block, Borders, Paragraph, Widget};
use std::io;
use std::io::Stdout;
use unicode_width::UnicodeWidthStr;

pub fn create_backend() -> CrosstermBackend<Stdout> {
Expand Down Expand Up @@ -110,7 +110,7 @@ pub fn write_buffer_to_console(
.iter()
.enumerate()
.filter(|(_previous, cell)| {
let curr_width = cell.symbol.width();
let curr_width = cell.symbol().width();
if curr_width == 0 {
return false;
}
Expand Down
Loading