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

refactor: Re-export ego-tree dependency from linutil core #811

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Cargo.lock

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

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ license = "MIT"
version = "24.9.28"
edition = "2021"

[workspace.dependencies]
ego-tree = "0.6.2"

[workspace]
members = ["tui", "core", "xtask"]
default-members = ["tui", "core"]
Expand Down
8 changes: 2 additions & 6 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ repository = "https://github.com/ChrisTitusTech/linutil/tree/main/core"
edition = "2021"
version.workspace = true
license.workspace = true
include = [
"src/*.rs",
"Cargo.toml",
"tabs/**",
]
include = ["src/*.rs", "Cargo.toml", "tabs/**"]

[dependencies]
include_dir = "0.7.4"
temp-dir = "0.1.14"
serde = { version = "1.0.205", features = ["derive"], default-features = false }
toml = { version = "0.8.19", features = ["parse"], default-features = false }
which = "6.0.3"
ego-tree = { workspace = true }
ego-tree = "0.9.0"
1 change: 1 addition & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod inner;

use std::rc::Rc;

pub use ego_tree;
use ego_tree::Tree;
use std::path::PathBuf;

Expand Down
1 change: 0 additions & 1 deletion tui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ tips = ["rand"]

[dependencies]
clap = { version = "4.5.20", features = ["derive"] }
ego-tree = { workspace = true }
oneshot = "0.1.8"
portable-pty = "0.8.1"
ratatui = "0.29.0"
Expand Down
3 changes: 1 addition & 2 deletions tui/src/filter.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::{state::ListEntry, theme::Theme};
use ego_tree::NodeId;
use linutil_core::Tab;
use linutil_core::{ego_tree::NodeId, Tab};
use ratatui::{
crossterm::event::{KeyCode, KeyEvent, KeyModifiers},
layout::{Position, Rect},
Expand Down
9 changes: 4 additions & 5 deletions tui/src/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ impl Shortcut {
}

fn to_spans(&self) -> Vec<Span<'static>> {
let mut ret: Vec<_> = self
.key_sequences
let description = Span::styled(self.desc, Style::default().italic());
self.key_sequences
.iter()
.flat_map(|seq| {
[
Expand All @@ -81,8 +81,7 @@ impl Shortcut {
Span::default().content("] "),
]
})
.collect();
ret.push(Span::styled(self.desc, Style::default().italic()));
ret
.chain(std::iter::once(description))
.collect()
}
}
4 changes: 2 additions & 2 deletions tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::{
running_command::RunningCommand,
theme::Theme,
};
use ego_tree::NodeId;
use linutil_core::{ListNode, TabList};

use linutil_core::{ego_tree::NodeId, ListNode, TabList};
#[cfg(feature = "tips")]
use rand::Rng;
use ratatui::{
Expand Down
Loading