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 to latest release #2100

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

* Update `ratatui` to `0.26.1` ([#2094](https://github.com/extrawurst/gitui/issues/2094), [#2098](https://github.com/extrawurst/gitui/issues/2098))

## [0.25.1] - 2024-02-23

### Fixes
Expand Down
95 changes: 69 additions & 26 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ log = "0.4"
notify = "6.1"
notify-debouncer-mini = "0.4"
once_cell = "1"
ratatui = { version = "=0.24.0", default-features = false, features = [
ratatui = { version = "0.26.0", default-features = false, features = [
'crossterm',
'serde',
] }
Expand Down
3 changes: 2 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,8 @@ impl App {
let table_area = r; // use entire area to allow drawing the horizontal separator line
let text_area = left_right[1];

let tabs = tab_labels.into_iter().map(Line::from).collect();
let tabs: Vec<_> =
tab_labels.into_iter().map(Line::from).collect();

f.render_widget(
Tabs::new(tabs)
Expand Down
2 changes: 1 addition & 1 deletion src/components/commitlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ impl CommitList {
let author = string_width_align(&e.author, author_width);

// commit author
txt.push(Span::styled::<String>(author, style_author));
txt.push(Span::styled::<String, Style>(author, style_author));

txt.push(splitter.clone());

Expand Down
3 changes: 1 addition & 2 deletions src/popups/blame_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ impl DrawableComponent for BlameFilePopup {
let title_with_highlight_progress =
format!("{title}{syntax_highlight_progress}");

let table = Table::new(rows)
.widths(&constraints)
let table = Table::new(rows, constraints)
.column_spacing(1)
.highlight_style(self.theme.text(true, true))
.block(
Expand Down
2 changes: 1 addition & 1 deletion src/popups/branchlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ impl BranchListPopup {
}

fn draw_tabs(&self, f: &mut Frame, r: Rect) {
let tabs = [Span::raw("Local"), Span::raw("Remote")]
let tabs: Vec<_> = [Span::raw("Local"), Span::raw("Remote")]
.iter()
.cloned()
.map(Line::from)
Expand Down
3 changes: 1 addition & 2 deletions src/popups/file_revlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,7 @@ impl FileRevlogPopup {
let title = self.get_title();
let rows = self.get_rows(now);

let table = Table::new(rows)
.widths(&constraints)
let table = Table::new(rows, constraints)
.column_spacing(1)
.highlight_style(self.theme.text(true, true))
.block(
Expand Down
3 changes: 1 addition & 2 deletions src/popups/taglist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ impl DrawableComponent for TagListPopup {
let rows = self.get_rows();
let number_of_rows = rows.len();

let table = Table::new(rows)
.widths(&constraints)
let table = Table::new(rows, constraints)
.column_spacing(1)
.highlight_style(self.theme.text(true, true))
.block(
Expand Down
10 changes: 4 additions & 6 deletions src/ui/scrolllist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@ where
{
fn render(self, area: Rect, buf: &mut Buffer) {
// Render items
List::new(
self.items.map(ListItem::new).collect::<Vec<ListItem>>(),
)
.block(self.block.unwrap_or_default())
.style(self.style)
.render(area, buf);
List::new(self.items.map(ListItem::new))
.block(self.block.unwrap_or_default())
.style(self.style)
.render(area, buf);
}
}

Expand Down