mirror of https://github.com/helix-editor/helix
feat: remove extra dependency
parent
f88364329a
commit
7dd782579e
|
@ -1469,7 +1469,6 @@ dependencies = [
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"grep-regex",
|
"grep-regex",
|
||||||
"grep-searcher",
|
"grep-searcher",
|
||||||
"heck",
|
|
||||||
"helix-core",
|
"helix-core",
|
||||||
"helix-dap",
|
"helix-dap",
|
||||||
"helix-event",
|
"helix-event",
|
||||||
|
|
|
@ -53,7 +53,6 @@ helix-loader = { path = "../helix-loader" }
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
once_cell = "1.20"
|
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"] }
|
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"] }
|
tui = { path = "../helix-tui", package = "helix-tui", default-features = false, features = ["crossterm"] }
|
||||||
crossterm = { version = "0.28", features = ["event-stream"] }
|
crossterm = { version = "0.28", features = ["event-stream"] }
|
||||||
|
|
|
@ -1717,12 +1717,13 @@ fn replace(cx: &mut Context) {
|
||||||
|
|
||||||
fn switch_case_impl<F>(cx: &mut Context, change_fn: F)
|
fn switch_case_impl<F>(cx: &mut Context, change_fn: F)
|
||||||
where
|
where
|
||||||
F: Fn(RopeSlice) -> Tendril,
|
F: Fn(&dyn Iterator<Item = char>) -> Tendril,
|
||||||
{
|
{
|
||||||
let (view, doc) = current!(cx.editor);
|
let (view, doc) = current!(cx.editor);
|
||||||
let selection = doc.selection(view.id);
|
let selection = doc.selection(view.id);
|
||||||
let transaction = Transaction::change_by_selection(doc.text(), selection, |range| {
|
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))
|
(range.from(), range.to(), Some(text))
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue