From b5c5e5d715a8b82001c3af9c944504eb44c3526a Mon Sep 17 00:00:00 2001 From: Ingrid Date: Sat, 30 Dec 2023 17:26:09 +0100 Subject: [PATCH] move session.rs from helix-term to helix-loader --- Cargo.lock | 26 --------------------- helix-loader/src/lib.rs | 1 + {helix-term => helix-loader}/src/session.rs | 2 +- helix-term/Cargo.toml | 3 --- helix-term/src/application.rs | 2 +- helix-term/src/lib.rs | 1 - helix-term/src/ui/prompt.rs | 3 ++- 7 files changed, 5 insertions(+), 33 deletions(-) rename {helix-term => helix-loader}/src/session.rs (95%) diff --git a/Cargo.lock b/Cargo.lock index c2c05e91f..d2f906698 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -93,25 +93,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "bincode" -version = "2.0.0-rc.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11ea1a0346b94ef188834a65c068a03aec181c94896d481d7a0a40d85b0ce95" -dependencies = [ - "bincode_derive", - "serde", -] - -[[package]] -name = "bincode_derive" -version = "2.0.0-rc.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e30759b3b99a1b802a7a3aa21c85c3ded5c28e1c83170d82d70f08bbf7f3e4c" -dependencies = [ - "virtue", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -1439,7 +1420,6 @@ version = "24.7.0" dependencies = [ "anyhow", "arc-swap", - "bincode", "chrono", "content_inspector", "crossterm", @@ -2571,12 +2551,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "virtue" -version = "0.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dcc60c0624df774c82a0ef104151231d37da4962957d691c011c852b2473314" - [[package]] name = "walkdir" version = "2.4.0" diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs index 1449b5a28..7707c76bc 100644 --- a/helix-loader/src/lib.rs +++ b/helix-loader/src/lib.rs @@ -1,5 +1,6 @@ pub mod config; pub mod grammar; +pub mod session; use helix_stdx::{env::current_working_dir, path}; diff --git a/helix-term/src/session.rs b/helix-loader/src/session.rs similarity index 95% rename from helix-term/src/session.rs rename to helix-loader/src/session.rs index 1c4174e78..63eb7ac8e 100644 --- a/helix-term/src/session.rs +++ b/helix-loader/src/session.rs @@ -1,4 +1,4 @@ -use helix_loader::{command_histfile, search_histfile}; +use crate::{command_histfile, search_histfile}; use std::{ fs::{File, OpenOptions}, io::{self, BufRead, BufReader, Write}, diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index bd637214f..5f691d44a 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -68,9 +68,6 @@ toml = "0.8" serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } -# session persistence -bincode = "2.0.0-rc.3" - # ripgrep for global search grep-regex = "0.1.12" grep-searcher = "0.1.13" diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index a710206e8..5b03a18eb 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -1,6 +1,7 @@ use arc_swap::{access::Map, ArcSwap}; use futures_util::Stream; use helix_core::{diagnostic::Severity, pos_at_coords, syntax, Selection}; +use helix_loader::session; use helix_lsp::{ lsp::{self, notification::Notification}, util::lsp_range_to_range, @@ -27,7 +28,6 @@ use crate::{ handlers, job::Jobs, keymap::Keymaps, - session, ui::{self, overlay::overlaid}, }; diff --git a/helix-term/src/lib.rs b/helix-term/src/lib.rs index f20544777..cf4fbd9fa 100644 --- a/helix-term/src/lib.rs +++ b/helix-term/src/lib.rs @@ -10,7 +10,6 @@ pub mod events; pub mod health; pub mod job; pub mod keymap; -pub mod session; pub mod ui; use std::path::Path; diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index c7f4b5e82..3a6da3153 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -1,7 +1,8 @@ use crate::compositor::{Component, Compositor, Context, Event, EventResult}; -use crate::{alt, ctrl, key, session, shift, ui}; +use crate::{alt, ctrl, key, shift, ui}; use arc_swap::ArcSwap; use helix_core::syntax; +use helix_loader::session; use helix_view::document::Mode; use helix_view::input::KeyEvent; use helix_view::keyboard::KeyCode;