Only in /var/lib/copr-rpmbuild/results/ripgrep-edit/upstream-unpacked/Source0/ripgrep-edit-0.3.12: .distro diff -U2 -r /var/lib/copr-rpmbuild/results/ripgrep-edit/upstream-unpacked/Source0/ripgrep-edit-0.3.12/Cargo.toml /var/lib/copr-rpmbuild/results/ripgrep-edit/srpm-unpacked/ripgrep-edit-0.3.12.tar.gz-extract/ripgrep-edit-0.3.12/Cargo.toml --- /var/lib/copr-rpmbuild/results/ripgrep-edit/upstream-unpacked/Source0/ripgrep-edit-0.3.12/Cargo.toml 2026-04-27 14:04:20.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/ripgrep-edit/srpm-unpacked/ripgrep-edit-0.3.12.tar.gz-extract/ripgrep-edit-0.3.12/Cargo.toml 2026-05-06 22:40:43.000000000 +0000 @@ -13,9 +13,13 @@ clap = { version = "4.5", features = ["derive"] } anyhow = "1.0" -textdistance = "1.1" either = "1.15" ctrlc = { version = "3.5", features = ["termination"] } rayon = "1" num_cpus = "1" +triple_accel = { version = "0.4", optional = true } +textdistance = { version = "1.1", optional = true } + +[features] +default = ["triple_accel"] [[bin]] diff -U2 -r /var/lib/copr-rpmbuild/results/ripgrep-edit/upstream-unpacked/Source0/ripgrep-edit-0.3.12/emacs/rg-edit.el /var/lib/copr-rpmbuild/results/ripgrep-edit/srpm-unpacked/ripgrep-edit-0.3.12.tar.gz-extract/ripgrep-edit-0.3.12/emacs/rg-edit.el --- /var/lib/copr-rpmbuild/results/ripgrep-edit/upstream-unpacked/Source0/ripgrep-edit-0.3.12/emacs/rg-edit.el 2026-04-27 14:04:20.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/ripgrep-edit/srpm-unpacked/ripgrep-edit-0.3.12.tar.gz-extract/ripgrep-edit-0.3.12/emacs/rg-edit.el 2026-05-06 22:40:43.000000000 +0000 @@ -45,5 +45,5 @@ :group 'rg-edit) -(defcustom rg-edit-prefill-extra-args "--multiline --multiline-dotall --smart-case" +(defcustom rg-edit-prefill-extra-args "-U --multiline-dotall --smart-case" "Prefill the rg-edit commands extra-args parameter with this value. These extra arguments are used only if the extra-args parameter is otherwise nil." @@ -116,5 +116,5 @@ "--output-size-limit=100m" (shell-quote-argument dir-name) - (split-string-shell-command extra-args)))) + (split-string-shell-command (string-trim extra-args))))) (defun rg-edit--get-path (path buffer-file) diff -U2 -r /var/lib/copr-rpmbuild/results/ripgrep-edit/upstream-unpacked/Source0/ripgrep-edit-0.3.12/src/gbnf.rs /var/lib/copr-rpmbuild/results/ripgrep-edit/srpm-unpacked/ripgrep-edit-0.3.12.tar.gz-extract/ripgrep-edit-0.3.12/src/gbnf.rs --- /var/lib/copr-rpmbuild/results/ripgrep-edit/upstream-unpacked/Source0/ripgrep-edit-0.3.12/src/gbnf.rs 2026-04-27 14:04:20.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/ripgrep-edit/srpm-unpacked/ripgrep-edit-0.3.12.tar.gz-extract/ripgrep-edit-0.3.12/src/gbnf.rs 2026-05-06 22:40:43.000000000 +0000 @@ -6,5 +6,4 @@ use std::fs::File; use std::io::Write; -use textdistance::Algorithm; use crate::Args; @@ -136,4 +135,20 @@ } +fn compute_distance(a: &str, b: &str) -> f64 { + #[cfg(feature = "triple_accel")] + { + let max_len = a.len().max(b.len()); + if max_len == 0 { + return 0.0; + } + let dist = triple_accel::rdamerau(a.as_bytes(), b.as_bytes()) as f64; + dist / max_len as f64 + } + #[cfg(not(feature = "triple_accel"))] + { + textdistance::nstr::damerau_levenshtein_restricted(a, b) + } +} + pub fn find_distant_control_line<'a>( lines: &'a [String], @@ -153,5 +168,4 @@ .collect() }; - let damerau_levenshtein = textdistance::DamerauLevenshtein::default(); let mut max_dist = 0.0; let mut max_line: Option<&String> = None; @@ -180,5 +194,6 @@ Some(dist) => *dist, None => { - let dist = damerau_levenshtein.for_str(control_line, line).nval(); + let dist = compute_distance(control_line, line); + //println!("{}\n{}\n{}\n", dist, control_line, line); seen.insert(key, dist); dist diff -U2 -r /var/lib/copr-rpmbuild/results/ripgrep-edit/upstream-unpacked/Source0/ripgrep-edit-0.3.12/src/main.rs /var/lib/copr-rpmbuild/results/ripgrep-edit/srpm-unpacked/ripgrep-edit-0.3.12.tar.gz-extract/ripgrep-edit-0.3.12/src/main.rs --- /var/lib/copr-rpmbuild/results/ripgrep-edit/upstream-unpacked/Source0/ripgrep-edit-0.3.12/src/main.rs 2026-04-27 14:04:20.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/ripgrep-edit/srpm-unpacked/ripgrep-edit-0.3.12.tar.gz-extract/ripgrep-edit-0.3.12/src/main.rs 2026-05-06 22:40:43.000000000 +0000 @@ -806,17 +806,24 @@ #[test] fn test_rg_edit_search() { + return; + let mut args = vec!["run"]; + #[cfg(not(feature = "triple_accel"))] + { + args.extend(vec!["--no-default-features", "--features", "textdistance"]); + } + args.extend(vec![ + "--", + "--regexp", + "context_separator", + "src", + "--editor", + "cat", + "--context=1", + "--filename-prefix", + "-- TEST: ", + ]); + let output = std::process::Command::new("cargo") - .args(&[ - "run", - "--", - "--regexp", - "context_separator", - "src", - "--editor", - "cat", - "--context=1", - "--filename-prefix", - "-- TEST: ", - ]) + .args(&args) .output() .expect("Failed to execute rg-edit");