Skip to content

Commit e297c1f

Browse files
committed
tui -> ratatui
tui is not maintained anymore and it seems that ratatui is the successor: fdehau/tui-rs#654
1 parent 19b820b commit e297c1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+161
-156
lines changed

Diff for: Cargo.lock

+17-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ bytesize = { version = "1.2", default-features = false }
2929
chrono = { version = "0.4", default-features = false, features = [ "clock" ] }
3030
clap = { version = "4.1", features = [ "env", "cargo" ] }
3131
crossbeam-channel = "0.5"
32-
crossterm = { version = "0.25", features = [ "serde" ] }
32+
crossterm = { version = "0.26.1", features = [ "serde" ] }
3333
dirs-next = "2.0"
3434
easy-cast = "0.5"
3535
filetreelist = { path = "./filetreelist", version = "0.5" }
@@ -49,7 +49,7 @@ simplelog = { version = "0.12", default-features = false }
4949
struct-patch = "0.2"
5050
syntect = { version = "5.0", default-features = false, features = ["parsing", "default-syntaxes", "default-themes", "html"] }
5151
textwrap = "0.16"
52-
tui = { version = "0.19", default-features = false, features = ['crossterm', 'serde'] }
52+
ratatui = { version = "0.20", default-features = false, features = ['crossterm', 'serde'] }
5353
unicode-segmentation = "1.10"
5454
unicode-truncate = "0.2"
5555
unicode-width = "0.1"

Diff for: src/app.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ use asyncgit::{
3434
};
3535
use crossbeam_channel::Sender;
3636
use crossterm::event::{Event, KeyEvent};
37-
use std::{
38-
cell::{Cell, RefCell},
39-
path::Path,
40-
rc::Rc,
41-
};
42-
use tui::{
37+
use ratatui::{
4338
backend::Backend,
4439
layout::{
4540
Alignment, Constraint, Direction, Layout, Margin, Rect,
@@ -48,6 +43,11 @@ use tui::{
4843
widgets::{Block, Borders, Paragraph, Tabs},
4944
Frame,
5045
};
46+
use std::{
47+
cell::{Cell, RefCell},
48+
path::Path,
49+
rc::Rc,
50+
};
5151
use unicode_width::UnicodeWidthStr;
5252

5353
#[derive(Clone)]

Diff for: src/cmdbar.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ use crate::{
22
components::CommandInfo, keys::SharedKeyConfig, strings,
33
ui::style::SharedTheme,
44
};
5-
use std::borrow::Cow;
6-
use tui::{
5+
use ratatui::{
76
backend::Backend,
87
layout::{Alignment, Rect},
98
text::{Span, Spans},
109
widgets::Paragraph,
1110
Frame,
1211
};
12+
use std::borrow::Cow;
1313
use unicode_width::UnicodeWidthStr;
1414

1515
enum DrawListEntry {

Diff for: src/components/blame_file.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ use asyncgit::{
1818
};
1919
use crossbeam_channel::Sender;
2020
use crossterm::event::Event;
21-
use std::convert::TryInto;
22-
use tui::{
21+
use ratatui::{
2322
backend::Backend,
2423
layout::{Constraint, Rect},
2524
symbols::line::VERTICAL,
2625
text::Span,
2726
widgets::{Block, Borders, Cell, Clear, Row, Table, TableState},
2827
Frame,
2928
};
29+
use std::convert::TryInto;
3030

3131
static NO_COMMIT_ID: &str = "0000000";
3232
static NO_AUTHOR: &str = "<no author>";

Diff for: src/components/branchlist.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ use asyncgit::{
2626
AsyncGitNotification,
2727
};
2828
use crossterm::event::Event;
29-
use std::{cell::Cell, convert::TryInto};
30-
use tui::{
29+
use ratatui::{
3130
backend::Backend,
3231
layout::{
3332
Alignment, Constraint, Direction, Layout, Margin, Rect,
@@ -36,6 +35,7 @@ use tui::{
3635
widgets::{Block, BorderType, Borders, Clear, Paragraph, Tabs},
3736
Frame,
3837
};
38+
use std::{cell::Cell, convert::TryInto};
3939
use ui::style::SharedTheme;
4040
use unicode_truncate::UnicodeTruncateStr;
4141

Diff for: src/components/changes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use asyncgit::{
1717
StatusItem, StatusItemType,
1818
};
1919
use crossterm::event::Event;
20+
use ratatui::{backend::Backend, layout::Rect, Frame};
2021
use std::path::Path;
21-
use tui::{backend::Backend, layout::Rect, Frame};
2222

2323
///
2424
pub struct ChangesComponent {

Diff for: src/components/commit.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ use asyncgit::{
2121
};
2222
use crossterm::event::Event;
2323
use easy_cast::Cast;
24-
use std::{
25-
fs::{read_to_string, File},
26-
io::{Read, Write},
27-
};
28-
use tui::{
24+
use ratatui::{
2925
backend::Backend,
3026
layout::{Alignment, Rect},
3127
widgets::Paragraph,
3228
Frame,
3329
};
30+
use std::{
31+
fs::{read_to_string, File},
32+
io::{Read, Write},
33+
};
3434

3535
enum CommitResult {
3636
ComitDone,

Diff for: src/components/commit_details/compare_details.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{
1414
use anyhow::Result;
1515
use asyncgit::sync::{self, CommitDetails, CommitId, RepoPathRef};
1616
use crossterm::event::Event;
17-
use tui::{
17+
use ratatui::{
1818
backend::Backend,
1919
layout::{Constraint, Direction, Layout, Rect},
2020
text::{Span, Spans, Text},

Diff for: src/components/commit_details/details.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ use asyncgit::sync::{
1515
self, CommitDetails, CommitId, CommitMessage, RepoPathRef, Tag,
1616
};
1717
use crossterm::event::Event;
18-
use std::clone::Clone;
19-
use std::{borrow::Cow, cell::Cell};
20-
use sync::CommitTags;
21-
use tui::{
18+
use ratatui::{
2219
backend::Backend,
2320
layout::{Constraint, Direction, Layout, Rect},
2421
style::{Modifier, Style},
2522
text::{Span, Spans, Text},
2623
Frame,
2724
};
25+
use std::clone::Clone;
26+
use std::{borrow::Cow, cell::Cell};
27+
use sync::CommitTags;
2828

2929
use super::style::Detail;
3030

Diff for: src/components/commit_details/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use compare_details::CompareDetailsComponent;
2222
use crossbeam_channel::Sender;
2323
use crossterm::event::Event;
2424
use details::DetailsComponent;
25-
use tui::{
25+
use ratatui::{
2626
backend::Backend,
2727
layout::{Constraint, Direction, Layout, Rect},
2828
Frame,

Diff for: src/components/commit_details/style.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{strings, ui::style::SharedTheme};
2+
use ratatui::text::Span;
23
use std::borrow::Cow;
3-
use tui::text::Span;
44

55
pub enum Detail {
66
Author,

Diff for: src/components/commitlist.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ use asyncgit::sync::{
1919
use chrono::{DateTime, Local};
2020
use crossterm::event::Event;
2121
use itertools::Itertools;
22-
use std::{
23-
borrow::Cow, cell::Cell, cmp, collections::BTreeMap,
24-
convert::TryFrom, time::Instant,
25-
};
26-
use tui::{
22+
use ratatui::{
2723
backend::Backend,
2824
layout::{Alignment, Rect},
2925
text::{Span, Spans},
3026
widgets::{Block, Borders, Paragraph},
3127
Frame,
3228
};
29+
use std::{
30+
borrow::Cow, cell::Cell, cmp, collections::BTreeMap,
31+
convert::TryFrom, time::Instant,
32+
};
3333

3434
const ELEMENTS_PER_LINE: usize = 9;
3535

Diff for: src/components/compare_commits.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use asyncgit::{
1818
};
1919
use crossbeam_channel::Sender;
2020
use crossterm::event::Event;
21-
use tui::{
21+
use ratatui::{
2222
backend::Backend,
2323
layout::{Constraint, Direction, Layout, Rect},
2424
widgets::Clear,

Diff for: src/components/create_branch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use anyhow::Result;
1313
use asyncgit::sync::{self, RepoPathRef};
1414
use crossterm::event::Event;
1515
use easy_cast::Cast;
16-
use tui::{
16+
use ratatui::{
1717
backend::Backend, layout::Rect, widgets::Paragraph, Frame,
1818
};
1919

Diff for: src/components/cred.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use anyhow::Result;
22
use crossterm::event::Event;
3-
use tui::{backend::Backend, layout::Rect, Frame};
3+
use ratatui::{backend::Backend, layout::Rect, Frame};
44

55
use asyncgit::sync::cred::BasicAuthCredential;
66

Diff for: src/components/diff.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ use asyncgit::{
2020
};
2121
use bytesize::ByteSize;
2222
use crossterm::event::Event;
23-
use std::{borrow::Cow, cell::Cell, cmp, path::Path};
24-
use tui::{
23+
use ratatui::{
2524
backend::Backend,
2625
layout::Rect,
2726
symbols,
2827
text::{Span, Spans},
2928
widgets::{Block, Borders, Paragraph},
3029
Frame,
3130
};
31+
use std::{borrow::Cow, cell::Cell, cmp, path::Path};
3232

3333
#[derive(Default)]
3434
struct Current {

Diff for: src/components/externaleditor.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ use crossterm::{
1616
terminal::{EnterAlternateScreen, LeaveAlternateScreen},
1717
ExecutableCommand,
1818
};
19-
use scopeguard::defer;
20-
use std::ffi::OsStr;
21-
use std::{env, io, path::Path, process::Command};
22-
use tui::{
19+
use ratatui::{
2320
backend::Backend,
2421
layout::Rect,
2522
text::{Span, Spans},
2623
widgets::{Block, BorderType, Borders, Clear, Paragraph},
2724
Frame,
2825
};
26+
use scopeguard::defer;
27+
use std::ffi::OsStr;
28+
use std::{env, io, path::Path, process::Command};
2929

3030
///
3131
pub struct ExternalEditorComponent {

Diff for: src/components/fetch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use asyncgit::{
2222
};
2323
use crossbeam_channel::Sender;
2424
use crossterm::event::Event;
25-
use tui::{
25+
use ratatui::{
2626
backend::Backend,
2727
layout::Rect,
2828
text::Span,

Diff for: src/components/file_find_popup.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ use anyhow::Result;
1313
use asyncgit::sync::TreeFile;
1414
use crossterm::event::Event;
1515
use fuzzy_matcher::FuzzyMatcher;
16-
use std::borrow::Cow;
17-
use tui::{
16+
use ratatui::{
1817
backend::Backend,
1918
layout::{Constraint, Direction, Layout, Margin, Rect},
2019
text::{Span, Spans},
2120
widgets::{Block, Borders, Clear},
2221
Frame,
2322
};
23+
use std::borrow::Cow;
2424

2525
pub struct FileFindPopup {
2626
queue: Queue,

Diff for: src/components/file_revlog.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use asyncgit::{
2424
use chrono::{DateTime, Local};
2525
use crossbeam_channel::Sender;
2626
use crossterm::event::Event;
27-
use tui::{
27+
use ratatui::{
2828
backend::Backend,
2929
layout::{Constraint, Direction, Layout, Rect},
3030
text::{Span, Spans, Text},

Diff for: src/components/help.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ use anyhow::Result;
1111
use asyncgit::hash;
1212
use crossterm::event::Event;
1313
use itertools::Itertools;
14-
use std::{borrow::Cow, cmp, convert::TryFrom};
15-
use tui::{
14+
use ratatui::{
1615
backend::Backend,
1716
layout::{Alignment, Constraint, Direction, Layout, Rect},
1817
style::{Modifier, Style},
1918
text::{Span, Spans},
2019
widgets::{Block, BorderType, Borders, Clear, Paragraph},
2120
Frame,
2221
};
22+
use std::{borrow::Cow, cmp, convert::TryFrom};
2323
use ui::style::SharedTheme;
2424

2525
///

Diff for: src/components/inspect_commit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use asyncgit::{
1717
};
1818
use crossbeam_channel::Sender;
1919
use crossterm::event::Event;
20-
use tui::{
20+
use ratatui::{
2121
backend::Backend,
2222
layout::{Constraint, Direction, Layout, Rect},
2323
widgets::Clear,

0 commit comments

Comments
 (0)