Skip to content

Commit

Permalink
chore(deps): bump ratatui to 0.29.0 (#2474)
Browse files Browse the repository at this point in the history
  • Loading branch information
pamburus authored Dec 27, 2024
1 parent fd9ef9b commit dda6675
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 65 deletions.
70 changes: 35 additions & 35 deletions Cargo.lock

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

7 changes: 2 additions & 5 deletions crates/atuin-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ serde_with = "3.8.1"

# encryption
rusty_paseto = { version = "0.7.0", default-features = false }
rusty_paserk = { version = "0.4.0", default-features = false, features = [
"v4",
"serde",
] }
rusty_paserk = { version = "0.4.0", default-features = false, features = ["v4", "serde"] }

# sync
urlencoding = { version = "2.1.0", optional = true }
Expand All @@ -71,7 +68,7 @@ indicatif = "0.17.7"
tiny-bip39 = "=1.0.0"

# theme
crossterm = { version = "0.27.0", features = ["serde"] }
crossterm = { version = "0.28.1", features = ["serde"] }
palette = { version = "0.7.5", features = ["serializing"] }
lazy_static = "1.4.0"
strum_macros = "0.26.3"
Expand Down
2 changes: 1 addition & 1 deletion crates/atuin-history/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ directories = { workspace = true }
indicatif = "0.17.5"
serde = { workspace = true }
serde_json = { workspace = true }
crossterm = { version = "0.27", features = ["use-dev-tty"] }
crossterm = { version = "0.28.1", features = ["use-dev-tty"] }
unicode-width = "0.1"
itertools = { workspace = true }
tokio = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions crates/atuin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ directories = { workspace = true }
indicatif = "0.17.5"
serde = { workspace = true }
serde_json = { workspace = true }
crossterm = { version = "0.27", features = ["use-dev-tty"] }
crossterm = { version = "0.28.1", features = ["use-dev-tty"] }
unicode-width = "0.1"
itertools = { workspace = true }
tokio = { workspace = true }
Expand All @@ -78,13 +78,13 @@ tiny-bip39 = "1"
futures-util = "0.3"
fuzzy-matcher = "0.3.7"
colored = "2.0.4"
ratatui = "0.27"
ratatui = "0.29.0"
tracing = "0.1"
tracing-subscriber = { workspace = true }
uuid = { workspace = true }
unicode-segmentation = "1.11.0"
sysinfo = "0.30.7"
regex="1.10.5"
regex = "1.10.5"

[target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies]
arboard = { version = "3.4", optional = true }
Expand Down
3 changes: 2 additions & 1 deletion crates/atuin/src/command/client/search/history_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use atuin_client::{
use atuin_common::utils::Escapable as _;
use ratatui::{
buffer::Buffer,
crossterm::style,
layout::Rect,
style::{Modifier, Style},
widgets::{Block, StatefulWidget, Widget},
Expand Down Expand Up @@ -206,7 +207,7 @@ impl DrawState<'_> {
{
// if not applying alternative highlighting to the whole row, color the command
style = self.theme.as_style(Meaning::AlertError);
style.attributes.set(crossterm::style::Attribute::Bold);
style.attributes.set(style::Attribute::Bold);
}

for section in h.command.escape_control().split_ascii_whitespace() {
Expand Down
2 changes: 1 addition & 1 deletion crates/atuin/src/command/client/search/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use atuin_client::{
history::{History, HistoryStats},
settings::Settings,
};
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use ratatui::{
crossterm::event::{KeyCode, KeyEvent, KeyModifiers},
layout::Rect,
prelude::{Constraint, Direction, Layout},
style::Style,
Expand Down
37 changes: 18 additions & 19 deletions crates/atuin/src/command/client/search/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ use std::{
};

use atuin_common::utils::{self, Escapable as _};
use crossterm::{
cursor::SetCursorStyle,
event::{
self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEvent, KeyModifiers,
KeyboardEnhancementFlags, MouseEvent, PopKeyboardEnhancementFlags,
PushKeyboardEnhancementFlags,
},
execute, terminal,
};
use eyre::Result;
use futures_util::FutureExt;
use semver::Version;
Expand All @@ -38,6 +29,15 @@ use crate::{command::client::search::engines, VERSION};

use ratatui::{
backend::CrosstermBackend,
crossterm::{
cursor::SetCursorStyle,
event::{
self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEvent, KeyModifiers,
KeyboardEnhancementFlags, MouseEvent, PopKeyboardEnhancementFlags,
PushKeyboardEnhancementFlags,
},
execute, terminal,
},
layout::{Alignment, Constraint, Direction, Layout},
prelude::*,
style::{Modifier, Style},
Expand Down Expand Up @@ -588,13 +588,13 @@ impl State {
theme: &Theme,
) {
let compact = match settings.style {
atuin_client::settings::Style::Auto => f.size().height < 14,
atuin_client::settings::Style::Auto => f.area().height < 14,
atuin_client::settings::Style::Compact => true,
atuin_client::settings::Style::Full => false,
};
let invert = settings.invert;
let border_size = if compact { 0 } else { 1 };
let preview_width = f.size().width - 2;
let preview_width = f.area().width - 2;
let preview_height = Self::calc_preview_height(
settings,
results,
Expand All @@ -604,12 +604,12 @@ impl State {
border_size,
preview_width,
);
let show_help = settings.show_help && (!compact || f.size().height > 1);
let show_help = settings.show_help && (!compact || f.area().height > 1);
// This is an OR, as it seems more likely for someone to wish to override
// tabs unexpectedly being missed, than unexpectedly present.
let hide_extra = settings.auto_hide_height != 0
&& compact
&& f.size().height <= settings.auto_hide_height;
&& f.area().height <= settings.auto_hide_height;
let show_tabs = settings.show_tabs && !hide_extra;
let chunks = Layout::default()
.direction(Direction::Vertical)
Expand Down Expand Up @@ -643,7 +643,7 @@ impl State {
}
.as_ref(),
)
.split(f.size());
.split(f.area());

let input_chunk = if invert { chunks[0] } else { chunks[3] };
let results_list_chunk = if invert { chunks[1] } else { chunks[2] };
Expand Down Expand Up @@ -722,9 +722,8 @@ impl State {
let message = Paragraph::new("Nothing to inspect")
.block(
Block::new()
.title(
Title::from(" Info ".to_string()).alignment(Alignment::Center),
)
.title(Title::from(" Info ".to_string()))
.title_alignment(Alignment::Center)
.borders(Borders::ALL)
.padding(Padding::vertical(2)),
)
Expand Down Expand Up @@ -774,11 +773,11 @@ impl State {
let extra_width = UnicodeWidthStr::width(self.search.input.substring());

let cursor_offset = if compact { 0 } else { 1 };
f.set_cursor(
f.set_cursor_position((
// Put cursor past the end of the input text
input_chunk.x + extra_width as u16 + PREFIX_LENGTH + 1 + cursor_offset,
input_chunk.y + cursor_offset,
);
));
}
}

Expand Down

0 comments on commit dda6675

Please sign in to comment.