Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] After writing a todo pressing esc cancels the todo #106

Closed
sathishmanohar opened this issue Mar 17, 2023 · 9 comments
Closed

[BUG] After writing a todo pressing esc cancels the todo #106

sathishmanohar opened this issue Mar 17, 2023 · 9 comments
Labels
bug Something isn't working completed Issues that are fixed and will be out in the next release

Comments

@sathishmanohar
Copy link
Contributor

Since dooit is vim inspired. I press esc after writing a todo description which currently cancels the whole todo. I was spooked by this behavior a couple of time now.

I think this behavior should only apply to empty to-dos and if the to do has a description then pressing esc should save the todo and not cancel it.

@sathishmanohar sathishmanohar added the bug Something isn't working label Mar 17, 2023
@kraanzu
Copy link
Owner

kraanzu commented Mar 18, 2023

Hmm... Actually, this was the behavior in the previous version but some people recommended against it!
There has to be some keybinding for canceling the todo so I went with this option!

Any ideas on how users should cancel the task addition/editing then?

@sathishmanohar
Copy link
Contributor Author

sathishmanohar commented Mar 18, 2023

This could work.

When a todo is empty. Esc just cancels the todo.
When a todo is not empty. Esc saves the todo.
    - After saving user can simply press xx to delete that todo
When a todo is not empty. Pressing <ctrl+l> just like shortcut for clear in terminal clears the todo 
and remains in insert mode. After that the user can either continue typing or press esc to cancel the todo.

@kraanzu
Copy link
Owner

kraanzu commented Mar 18, 2023

Hmmm... Maybe I can add something to the config regarding this!

@sathishmanohar
Copy link
Contributor Author

Got it. At least there could be a prompt before cancelling which can be disabled in config.

@sprek
Copy link

sprek commented Jun 8, 2023

I would love this enhancement. My muscle memory keeps having me press escape when I'm done editing. Sometimes I'll rewrite the same todo 3 times because I keep pressing escape when I'm done typing.
The way it is now seems a bit strange. I'll create a new todo with 'a' type my todo, then hit enter. And now I'm suddenly typing a new todo item, so I have to hit escape to get out of it.
I'd prefer if it wouldn't automatically create a new empty todo after I hit enter. I wouldn't mind having to press 'a' again to add a new entry.

But ideally, I'd hit 'a' to add a new item. Type it in, hit escape, and it's saved, without it adding another empty item after.

@surfingtomchen
Copy link

I would love this enhancement. My muscle memory keeps having me press escape when I'm done editing. Sometimes I'll rewrite the same todo 3 times because I keep pressing escape when I'm done typing. The way it is now seems a bit strange. I'll create a new todo with 'a' type my todo, then hit enter. And now I'm suddenly typing a new todo item, so I have to hit escape to get out of it. I'd prefer if it wouldn't automatically create a new empty todo after I hit enter. I wouldn't mind having to press 'a' again to add a new entry.

But ideally, I'd hit 'a' to add a new item. Type it in, hit escape, and it's saved, without it adding another empty item after.

agree, the new todo item once I finished typing bugs me too. How about using Ctrl+Enter as finishing typing current item and start a new item while using Enter as only finishing current item?

@alai
Copy link

alai commented Jun 16, 2023

Since dooit is vim inspired. I press esc after writing a todo description which currently cancels the whole todo. I was spooked by this behavior a couple of time now.

I think this behavior should only apply to empty to-dos and if the to do has a description then pressing esc should save the todo and not cancel it.

Same here!

@kraanzu
Copy link
Owner

kraanzu commented Jun 16, 2023

How about using Ctrl+Enter as finishing typing current item and start a new item while using Enter as only finishing current item?

Sounds like a good idea but the in the terminal enter, shift+enter and ctrl+enter are the same
You can verify this in textual keys by writing textual keys in your terminal

I guess I'll change it to stop by pressing escape and the user can delete the item if they want to delete it?
Or maybe then can press something else to cancel it..maybe ctrl-c? :p

@sathishmanohar
Copy link
Contributor Author

You may want to look into terminal shortcuts. These will make the editing more consistent across terminals.

Ctrl+u to delete from cursor to beginning of the line
Ctrl+k to delete from cursor to end of the line
Ctrl+a to go to the start of the line
Ctrl+e to go to the end of the line
Ctrl+c to go to cancel the ongoing todo
Esc saves like in vim

@kraanzu kraanzu added the completed Issues that are fixed and will be out in the next release label Aug 15, 2023
@kraanzu kraanzu closed this as completed in 018f12c Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completed Issues that are fixed and will be out in the next release
Projects
None yet
Development

No branches or pull requests

5 participants