Skip to content

Commit

Permalink
tui -> ratatui
Browse files Browse the repository at this point in the history
tui is not maintained anymore and it seems that ratatui is the successor: fdehau/tui-rs#654
  • Loading branch information
extrawurst committed Apr 19, 2023
1 parent 19b820b commit 904885e
Show file tree
Hide file tree
Showing 57 changed files with 161 additions and 156 deletions.
34 changes: 17 additions & 17 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 @@ -29,7 +29,7 @@ bytesize = { version = "1.2", default-features = false }
chrono = { version = "0.4", default-features = false, features = [ "clock" ] }
clap = { version = "4.1", features = [ "env", "cargo" ] }
crossbeam-channel = "0.5"
crossterm = { version = "0.25", features = [ "serde" ] }
crossterm = { version = "0.26.1", features = [ "serde" ] }
dirs-next = "2.0"
easy-cast = "0.5"
filetreelist = { path = "./filetreelist", version = "0.5" }
Expand All @@ -40,6 +40,7 @@ log = "0.4"
notify = "5.1"
notify-debouncer-mini = "0.2"
once_cell = "1"
ratatui = { version = "0.20", default-features = false, features = ['crossterm', 'serde'] }
rayon-core = "1.11"
ron = "0.8"
scopeguard = "1.1"
Expand All @@ -49,7 +50,6 @@ simplelog = { version = "0.12", default-features = false }
struct-patch = "0.2"
syntect = { version = "5.0", default-features = false, features = ["parsing", "default-syntaxes", "default-themes", "html"] }
textwrap = "0.16"
tui = { version = "0.19", default-features = false, features = ['crossterm', 'serde'] }
unicode-segmentation = "1.10"
unicode-truncate = "0.2"
unicode-width = "0.1"
Expand Down
12 changes: 6 additions & 6 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ use asyncgit::{
};
use crossbeam_channel::Sender;
use crossterm::event::{Event, KeyEvent};
use std::{
cell::{Cell, RefCell},
path::Path,
rc::Rc,
};
use tui::{
use ratatui::{
backend::Backend,
layout::{
Alignment, Constraint, Direction, Layout, Margin, Rect,
Expand All @@ -48,6 +43,11 @@ use tui::{
widgets::{Block, Borders, Paragraph, Tabs},
Frame,
};
use std::{
cell::{Cell, RefCell},
path::Path,
rc::Rc,
};
use unicode_width::UnicodeWidthStr;

#[derive(Clone)]
Expand Down
4 changes: 2 additions & 2 deletions src/cmdbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ use crate::{
components::CommandInfo, keys::SharedKeyConfig, strings,
ui::style::SharedTheme,
};
use std::borrow::Cow;
use tui::{
use ratatui::{
backend::Backend,
layout::{Alignment, Rect},
text::{Span, Spans},
widgets::Paragraph,
Frame,
};
use std::borrow::Cow;
use unicode_width::UnicodeWidthStr;

enum DrawListEntry {
Expand Down
4 changes: 2 additions & 2 deletions src/components/blame_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ use asyncgit::{
};
use crossbeam_channel::Sender;
use crossterm::event::Event;
use std::convert::TryInto;
use tui::{
use ratatui::{
backend::Backend,
layout::{Constraint, Rect},
symbols::line::VERTICAL,
text::Span,
widgets::{Block, Borders, Cell, Clear, Row, Table, TableState},
Frame,
};
use std::convert::TryInto;

static NO_COMMIT_ID: &str = "0000000";
static NO_AUTHOR: &str = "<no author>";
Expand Down
4 changes: 2 additions & 2 deletions src/components/branchlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ use asyncgit::{
AsyncGitNotification,
};
use crossterm::event::Event;
use std::{cell::Cell, convert::TryInto};
use tui::{
use ratatui::{
backend::Backend,
layout::{
Alignment, Constraint, Direction, Layout, Margin, Rect,
Expand All @@ -36,6 +35,7 @@ use tui::{
widgets::{Block, BorderType, Borders, Clear, Paragraph, Tabs},
Frame,
};
use std::{cell::Cell, convert::TryInto};
use ui::style::SharedTheme;
use unicode_truncate::UnicodeTruncateStr;

Expand Down
2 changes: 1 addition & 1 deletion src/components/changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use asyncgit::{
StatusItem, StatusItemType,
};
use crossterm::event::Event;
use ratatui::{backend::Backend, layout::Rect, Frame};
use std::path::Path;
use tui::{backend::Backend, layout::Rect, Frame};

///
pub struct ChangesComponent {
Expand Down
10 changes: 5 additions & 5 deletions src/components/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ use asyncgit::{
};
use crossterm::event::Event;
use easy_cast::Cast;
use std::{
fs::{read_to_string, File},
io::{Read, Write},
};
use tui::{
use ratatui::{
backend::Backend,
layout::{Alignment, Rect},
widgets::Paragraph,
Frame,
};
use std::{
fs::{read_to_string, File},
io::{Read, Write},
};

enum CommitResult {
ComitDone,
Expand Down
2 changes: 1 addition & 1 deletion src/components/commit_details/compare_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
use anyhow::Result;
use asyncgit::sync::{self, CommitDetails, CommitId, RepoPathRef};
use crossterm::event::Event;
use tui::{
use ratatui::{
backend::Backend,
layout::{Constraint, Direction, Layout, Rect},
text::{Span, Spans, Text},
Expand Down
8 changes: 4 additions & 4 deletions src/components/commit_details/details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ use asyncgit::sync::{
self, CommitDetails, CommitId, CommitMessage, RepoPathRef, Tag,
};
use crossterm::event::Event;
use std::clone::Clone;
use std::{borrow::Cow, cell::Cell};
use sync::CommitTags;
use tui::{
use ratatui::{
backend::Backend,
layout::{Constraint, Direction, Layout, Rect},
style::{Modifier, Style},
text::{Span, Spans, Text},
Frame,
};
use std::clone::Clone;
use std::{borrow::Cow, cell::Cell};
use sync::CommitTags;

use super::style::Detail;

Expand Down
2 changes: 1 addition & 1 deletion src/components/commit_details/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use compare_details::CompareDetailsComponent;
use crossbeam_channel::Sender;
use crossterm::event::Event;
use details::DetailsComponent;
use tui::{
use ratatui::{
backend::Backend,
layout::{Constraint, Direction, Layout, Rect},
Frame,
Expand Down
2 changes: 1 addition & 1 deletion src/components/commit_details/style.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{strings, ui::style::SharedTheme};
use ratatui::text::Span;
use std::borrow::Cow;
use tui::text::Span;

pub enum Detail {
Author,
Expand Down
10 changes: 5 additions & 5 deletions src/components/commitlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ use asyncgit::sync::{
use chrono::{DateTime, Local};
use crossterm::event::Event;
use itertools::Itertools;
use std::{
borrow::Cow, cell::Cell, cmp, collections::BTreeMap,
convert::TryFrom, time::Instant,
};
use tui::{
use ratatui::{
backend::Backend,
layout::{Alignment, Rect},
text::{Span, Spans},
widgets::{Block, Borders, Paragraph},
Frame,
};
use std::{
borrow::Cow, cell::Cell, cmp, collections::BTreeMap,
convert::TryFrom, time::Instant,
};

const ELEMENTS_PER_LINE: usize = 9;

Expand Down
2 changes: 1 addition & 1 deletion src/components/compare_commits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use asyncgit::{
};
use crossbeam_channel::Sender;
use crossterm::event::Event;
use tui::{
use ratatui::{
backend::Backend,
layout::{Constraint, Direction, Layout, Rect},
widgets::Clear,
Expand Down
2 changes: 1 addition & 1 deletion src/components/create_branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use anyhow::Result;
use asyncgit::sync::{self, RepoPathRef};
use crossterm::event::Event;
use easy_cast::Cast;
use tui::{
use ratatui::{
backend::Backend, layout::Rect, widgets::Paragraph, Frame,
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/cred.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Result;
use crossterm::event::Event;
use tui::{backend::Backend, layout::Rect, Frame};
use ratatui::{backend::Backend, layout::Rect, Frame};

use asyncgit::sync::cred::BasicAuthCredential;

Expand Down
4 changes: 2 additions & 2 deletions src/components/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ use asyncgit::{
};
use bytesize::ByteSize;
use crossterm::event::Event;
use std::{borrow::Cow, cell::Cell, cmp, path::Path};
use tui::{
use ratatui::{
backend::Backend,
layout::Rect,
symbols,
text::{Span, Spans},
widgets::{Block, Borders, Paragraph},
Frame,
};
use std::{borrow::Cow, cell::Cell, cmp, path::Path};

#[derive(Default)]
struct Current {
Expand Down
8 changes: 4 additions & 4 deletions src/components/externaleditor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ use crossterm::{
terminal::{EnterAlternateScreen, LeaveAlternateScreen},
ExecutableCommand,
};
use scopeguard::defer;
use std::ffi::OsStr;
use std::{env, io, path::Path, process::Command};
use tui::{
use ratatui::{
backend::Backend,
layout::Rect,
text::{Span, Spans},
widgets::{Block, BorderType, Borders, Clear, Paragraph},
Frame,
};
use scopeguard::defer;
use std::ffi::OsStr;
use std::{env, io, path::Path, process::Command};

///
pub struct ExternalEditorComponent {
Expand Down
2 changes: 1 addition & 1 deletion src/components/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use asyncgit::{
};
use crossbeam_channel::Sender;
use crossterm::event::Event;
use tui::{
use ratatui::{
backend::Backend,
layout::Rect,
text::Span,
Expand Down
4 changes: 2 additions & 2 deletions src/components/file_find_popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ use anyhow::Result;
use asyncgit::sync::TreeFile;
use crossterm::event::Event;
use fuzzy_matcher::FuzzyMatcher;
use std::borrow::Cow;
use tui::{
use ratatui::{
backend::Backend,
layout::{Constraint, Direction, Layout, Margin, Rect},
text::{Span, Spans},
widgets::{Block, Borders, Clear},
Frame,
};
use std::borrow::Cow;

pub struct FileFindPopup {
queue: Queue,
Expand Down
2 changes: 1 addition & 1 deletion src/components/file_revlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use asyncgit::{
use chrono::{DateTime, Local};
use crossbeam_channel::Sender;
use crossterm::event::Event;
use tui::{
use ratatui::{
backend::Backend,
layout::{Constraint, Direction, Layout, Rect},
text::{Span, Spans, Text},
Expand Down
4 changes: 2 additions & 2 deletions src/components/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ use anyhow::Result;
use asyncgit::hash;
use crossterm::event::Event;
use itertools::Itertools;
use std::{borrow::Cow, cmp, convert::TryFrom};
use tui::{
use ratatui::{
backend::Backend,
layout::{Alignment, Constraint, Direction, Layout, Rect},
style::{Modifier, Style},
text::{Span, Spans},
widgets::{Block, BorderType, Borders, Clear, Paragraph},
Frame,
};
use std::{borrow::Cow, cmp, convert::TryFrom};
use ui::style::SharedTheme;

///
Expand Down
Loading

0 comments on commit 904885e

Please sign in to comment.