Fix for breaking change in ratatui 0.24.0 (#1352)

This commit is contained in:
Tobias Genannt 2023-10-28 14:30:02 +02:00 committed by GitHub
parent fa7caf430a
commit 2066778780
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 5 deletions

14
Cargo.lock generated
View file

@ -1691,6 +1691,15 @@ dependencies = [
"logos-codegen",
]
[[package]]
name = "lru"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1efa59af2ddfad1854ae27d75009d538d0998b4b2fd47083e743ac1a10e46c60"
dependencies = [
"hashbrown 0.14.2",
]
[[package]]
name = "malloc_buf"
version = "0.0.6"
@ -2289,15 +2298,16 @@ dependencies = [
[[package]]
name = "ratatui"
version = "0.23.0"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e2e4cd95294a85c3b4446e63ef054eea43e0205b1fd60120c16b74ff7ff96ad"
checksum = "0ebc917cfb527a566c37ecb94c7e3fd098353516fb4eb6bea17015ade0182425"
dependencies = [
"bitflags 2.4.1",
"cassowary",
"crossterm",
"indoc",
"itertools",
"lru",
"paste",
"strum",
"unicode-segmentation",

View file

@ -70,7 +70,7 @@ tiny-bip39 = "1"
futures-util = "0.3"
fuzzy-matcher = "0.3.7"
colored = "2.0.4"
ratatui = "0.23"
ratatui = "0.24"
tracing = "0.1"
cli-clipboard = "0.4.0"

View file

@ -29,7 +29,7 @@ use super::{
};
use crate::{command::client::search::engines, VERSION};
use ratatui::{
backend::{Backend, CrosstermBackend},
backend::CrosstermBackend,
layout::{Alignment, Constraint, Direction, Layout},
style::{Color, Modifier, Style},
text::{Line, Span, Text},
@ -312,7 +312,7 @@ impl State {
#[allow(clippy::cast_possible_truncation)]
#[allow(clippy::bool_to_int_with_if)]
fn draw<T: Backend>(&mut self, f: &mut Frame<'_, T>, results: &[History], settings: &Settings) {
fn draw(&mut self, f: &mut Frame, results: &[History], settings: &Settings) {
let compact = match settings.style {
atuin_client::settings::Style::Auto => f.size().height < 14,
atuin_client::settings::Style::Compact => true,