feat: enable removing column by index

This commit is contained in:
xeruf 2024-07-23 23:04:55 +03:00
parent ab28cf4fd7
commit 72af6bfd61
1 changed files with 6 additions and 1 deletions

View File

@ -104,7 +104,12 @@ async fn main() {
Some(':') => match input[1..2].parse::<usize>() { Some(':') => match input[1..2].parse::<usize>() {
Ok(index) => { Ok(index) => {
tasks.properties.insert(index, input[2..].to_string()); let value = input[2..].to_string();
if tasks.properties.get(index) == Some(&value) {
tasks.properties.remove(index);
} else {
tasks.properties.insert(index, value);
}
} }
Err(_) => { Err(_) => {
let prop = &input[1..]; let prop = &input[1..];