Revert "Write updated selections to fifo"

This reverts commit 971a7b9ca6.
This commit is contained in:
Austen Adler 2022-01-23 23:00:50 -05:00
parent 971a7b9ca6
commit f4b47fbe12
2 changed files with 4 additions and 12 deletions

View File

@ -47,8 +47,7 @@ define-command sort-selections -params 0.. %{
# TODO: Send additional parameters
rust-selection-sort -R "$regex" -f "$kak_command_fifo" -- "$@"
rust-selection-sort -R "$regex" $args -- "$@" > "$kak_command_fifo"
}
exec R
}

View File

@ -3,8 +3,6 @@
use alphanumeric_sort::compare_str;
use clap::Parser;
use regex::Regex;
use std::fs::OpenOptions;
use std::io::Write;
use std::path::PathBuf;
struct KakMessage(String, Option<String>);
@ -93,12 +91,7 @@ fn run() -> Result<(), KakMessage> {
}
});
let mut f = OpenOptions::new()
.write(true)
.append(true)
.open(&options.fifo_name)?;
write!(f, "reg '\"'")?;
print!("reg '\"'");
let iter: Box<dyn Iterator<Item = _>> = if options.reverse {
Box::new(zipped.iter().rev())
@ -108,9 +101,9 @@ fn run() -> Result<(), KakMessage> {
for i in iter {
let new_selection = i.0.replace('\'', "''");
write!(f, " '{}'", new_selection)?;
print!(" '{}'", new_selection);
}
write!(f, " ;")?;
print!(" ;");
Ok(())
}