From 72bcfbd1a0b61779c9778514c1cdd847b8f5f620 Mon Sep 17 00:00:00 2001 From: hao Date: Wed, 26 Jun 2024 07:05:02 -0400 Subject: [PATCH] new field splitter for new fzf version --- src/displace.rs | 2 +- src/input.rs | 2 +- src/main.rs | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/displace.rs b/src/displace.rs index 919fa07b..37901cb0 100644 --- a/src/displace.rs +++ b/src/displace.rs @@ -74,7 +74,7 @@ pub async fn displace(opts: &Options, input: RowIn) -> Result { for range in ranges { let repr = Colour::Red.paint(format!("{range}")); fzf_lines.push(&name); - let line = format!("\n\n\n\n{repr}\0"); + let line = format!("\x04 {repr}\0"); fzf_lines.push(&line); } fzf_lines diff --git a/src/input.rs b/src/input.rs index eb570180..5ecf72ee 100644 --- a/src/input.rs +++ b/src/input.rs @@ -36,7 +36,7 @@ struct DiffRow(PathBuf, DiffRange); fn p_row(row: &str) -> Result { let f = || Die::ArgumentError(String::new()); let ff = |_| f(); - let preg = "\n\n\n\n@@ -(\\d+),(\\d+) \\+(\\d+),(\\d+) @@$"; + let preg = "\x04 @@ -(\\d+),(\\d+) \\+(\\d+),(\\d+) @@$"; let re = Regex::new(preg).map_err(Die::RegexError)?; let captures = re.captures(row).ok_or_else(f)?; diff --git a/src/main.rs b/src/main.rs index f47cf80c..a2a2c246 100644 --- a/src/main.rs +++ b/src/main.rs @@ -99,6 +99,7 @@ fn main() -> impl Termination { match rt.block_on(run(threads)).err() { None => ExitCode::SUCCESS, + // TODO: 0xC000013Au32 for windows Some(Die::Interrupt) => ExitCode::from(130), Some(e) => { eprintln!("{}", Colour::Red.paint(format!("{e}")));