From 7dd782579ee69810391d57c1810ac62176f3ca65 Mon Sep 17 00:00:00 2001 From: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com> Date: Fri, 20 Dec 2024 07:08:04 +0000 Subject: [PATCH] feat: remove extra dependency --- Cargo.lock | 1 - helix-term/Cargo.toml | 1 - helix-term/src/commands.rs | 5 +++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 586fb4ba7..68ad11249 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1469,7 +1469,6 @@ dependencies = [ "futures-util", "grep-regex", "grep-searcher", - "heck", "helix-core", "helix-dap", "helix-event", diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index 1f959e48c..bbad37f07 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -53,7 +53,6 @@ helix-loader = { path = "../helix-loader" } anyhow = "1" once_cell = "1.20" -heck = "0.5" tokio = { version = "1", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot"] } tui = { path = "../helix-tui", package = "helix-tui", default-features = false, features = ["crossterm"] } crossterm = { version = "0.28", features = ["event-stream"] } diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 9b3013c8d..b608ef9f9 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1717,12 +1717,13 @@ fn replace(cx: &mut Context) { fn switch_case_impl(cx: &mut Context, change_fn: F) where - F: Fn(RopeSlice) -> Tendril, + F: Fn(&dyn Iterator) -> Tendril, { let (view, doc) = current!(cx.editor); let selection = doc.selection(view.id); let transaction = Transaction::change_by_selection(doc.text(), selection, |range| { - let text: Tendril = change_fn(range.slice(doc.text().slice(..))); + let chars = range.slice(doc.text().slice(..)).chars(); + let text = change_fn(&chars); (range.from(), range.to(), Some(text)) });