From 526b6fef247c56f6491abc9f9b3464c19f10a6d1 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sun, 2 Oct 2022 21:41:09 -0400 Subject: [PATCH] Use yank registers for set --- src/set.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/set.rs b/src/set.rs index 6cca435..99f4bac 100644 --- a/src/set.rs +++ b/src/set.rs @@ -1,6 +1,6 @@ // use crate::utils; use kakplugin::{ - get_selections, get_selections_with_desc, set_selections_desc, types::Register, KakError, + get_selections, get_selections_with_desc, reg, set_selections_desc, types::Register, KakError, }; use linked_hash_map::LinkedHashMap; use linked_hash_set::LinkedHashSet; @@ -75,19 +75,19 @@ pub fn set<'sel>(options: &'_ Options) -> Result { let (left_selections, right_selections) = match (&left_register, &right_register) { (Register::Underscore, r) => { let l_selections = get_selections(None)?; - let r_selections = get_selections(Some(&format!("\"{r}z")))?; + let r_selections = reg(*r, None)?; (l_selections, r_selections) } (l, Register::Underscore) => { let r_selections = get_selections(None)?; - let l_selections = get_selections(Some(&format!("\"{l}z")))?; + let l_selections = reg(*l, None)?; (l_selections, r_selections) } (l, r) => { - let l_selections = get_selections(Some(&format!("\"{l}z")))?; - let r_selections = get_selections(Some(&format!("\"{r}z")))?; + let l_selections = reg(*l, None)?; + let r_selections = reg(*r, None)?; (l_selections, r_selections) } @@ -189,7 +189,6 @@ fn reduce_selections<'sel, 'a>( } /// Writes the result of a set operation to a new kak buffer - fn print_result(key_set_operation_result: LinkedHashSet<&str>) -> Result<(), KakError> { // Manually set selections so we don't have to allocate a string let mut f = kakplugin::open_command_fifo()?;