vonshednob / pter

Manage your todo.txt in a commandline user interface (TUI)
https://vonshednob.cc/pter/
MIT License
102 stars 6 forks source link

Delete a task #9

Closed maxigaz closed 2 years ago

maxigaz commented 2 years ago

How can I delete a task in pter (v2.2.0)? I've checked man pter and the built-in help several times, but I couldn't find a keyboard shortcut or command for this.

vonshednob commented 2 years ago

That's correct. There is not functionality to delete tasks. Only to hide and to mark as done.

So far it seemed a very drastic measure to actually delete a task.

maxigaz commented 2 years ago

So far it seemed a very drastic measure to actually delete a task.

Do you mean "drastic" from the point of view of usability or a technical one? I personally use deleting all the time while editing my instances of todo.txt in Neovim. The only exception is when I want to explicitly archive tasks marked as done (by moving them to done.txt).

vonshednob commented 2 years ago

Drastic in the sense that it can't be undone (not unless there is some additional mechanism in the background, like backups or version control or something).

vonshednob commented 2 years ago

Let’s put it like this: I don’t object to this feature, but it should be disabled by default (i.e. no default shortcut to delete a task).

I’ll just leave it open for now. If there is more pressure from other people to have this feature in, I’ll take care of it, but if someone feels like implementing it, merge requests are welcome, of course :)

Does this work for you, @maxigaz ?

maxigaz commented 2 years ago

it should be disabled by default (i.e. no default shortcut to delete a task).

Yes, I can see that as a viable option until an undo/redo feature is in place.

I’ll just leave it open for now. If there is more pressure from other people to have this feature in, I’ll take care of it, but if someone feels like implementing it, merge requests are welcome, of course :)

Does this work for you, @maxigaz ?

Well, the lack of this feature is the biggest reason I'm not using pter as a daily driver for now. However, I'd be happy to come back to it when it's implemented.

vonshednob commented 2 years ago

Well, the lack of this feature is the biggest reason I'm not using pter as a daily driver for now. However, I'd be happy to come back to it when it's implemented.

Quite the show-stopper then, eh? I’ll see if I have time next weekend to implement this.

[…] until an undo/redo feature is in place.

I had not yet considered undo/redo to be necessary :thinking: but I suppose with drastic functions like delete it might be necessary.

maxigaz commented 2 years ago

I had not yet considered undo/redo to be necessary but I suppose with drastic functions like delete it might be necessary.

Oh? Earlier, you wrote:

Drastic in the sense that it can't be undone (not unless there is some additional mechanism in the background, like backups or version control or something).

So, I thought you meant that as the basis of undo/redo, like pressing u or Ctrl-r in Vim.

I’ll see if I have time next weekend to implement this.

Great! Thank you!

vonshednob commented 2 years ago

Looks like I found some time already. The new version contains the deletion functionality.

You can now bind a key to delete-task in pter and qpter. But please be sure to also set the delete-is option in the [General] section of your configuration file, because that option is by default set to disabled, which means that nothing happens, even if you bind delete to some key.

The possible values for delete-is are permanent (actually deleting the task), or trash (which will save the task in a trash file instead of just deleting it). The trash file can be configured through the trash-file option.

maxigaz commented 2 years ago

Thank you very much!