For set operations, default to ^ and _ registers

This commit is contained in:
Austen Adler 2022-11-06 11:16:04 -05:00
parent 0a80cfe7e3
commit 4d2bf938b5

View File

@ -372,6 +372,15 @@ fn parse_arguments(args: &[String]) -> Result<(Register, Operation, Register), K
Register::from_str(r)?,
))
}
[middle] => {
// They gave us one argument like "-"
// Default to (current selection)(operation)(^ register (set with Z)) => _-^
Ok((
Register::Underscore,
Operation::from_str(middle)?,
Register::Caret,
))
}
_ => Err(KakError::Custom(
"Invalid arguments to set command".to_string(),
)),