You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
oh-my-fish/plugins/ta/cli/ta.cli.undo.fish

22 lines
568 B
Fish

function ta.cli.undo
if test $__ta_undo_lock = false
if test (ta.util.tasks.count) -gt 0
# Display task for the last time.
ta.util.get.tail | grep -E --color=always ".*"
if sed -Ei.bak '$ d' $__ta_file_data
rm $__ta_file_data.bak
else
set -l code $status
cp $__ta_file_data.bak $__ta_file_data
return $code
end
set -g __ta_undo_lock true
else
echo "There are no tasks."
return $__ta_error_no_tasks
end
end
echo "The undo stack is locked until a new task is added."
end