Skip to content

Commit

Permalink
new field splitter for new fzf version
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-jpq committed Jun 26, 2024
1 parent ce8ea0e commit 72bcfbd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/displace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub async fn displace(opts: &Options, input: RowIn) -> Result<OsString, Die> {
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
Expand Down
2 changes: 1 addition & 1 deletion src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct DiffRow(PathBuf, DiffRange);
fn p_row(row: &str) -> Result<DiffRow, Die> {
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)?;

Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}")));
Expand Down

0 comments on commit 72bcfbd

Please sign in to comment.