danielmagnussons / orgmode

orgmode is for keeping notes, maintaining TODO lists, planning projects, and authoring documents with a fast and effective plain-text system.
MIT License
753 stars 70 forks source link

Pressing enter on TODO now changes to WORKING, and then DONE #71

Closed martisak closed 6 years ago

martisak commented 6 years ago

This is an attempt to tick of one of the boxes in the todo-list. Pressing enter on TODO now changes the text to WORKING. Pressing enter again changes it to DONE, and again back to TODO. There is also a new pattern 'orgmode.todo', but no associated color change in this commit.

This is an awesome plugin, only used it for a few days but seems like it could be life changing :)

danielmagnussons commented 6 years ago

Hi, nice! =)

Can we get an example how this works in install.org? Not sure I test this correctly.

martisak commented 6 years ago

I've added an example to install.org. You have found a bug - this only works on "- TODO", and not when TODO is somewhere else on the line for example. If it should work, then I will work on fixing the bug :)

danielmagnussons commented 6 years ago

Something buggy when having keyword last in file(TODO) and pressing enter on it:

- WORKING
[ ] ls

- TODO
martisak commented 6 years ago

If I got this right: if you place the cursor after the second O on the last line and press enter then WORKING cycles, but if you place the cursor inside TODO, it works as expected?

On any other line, putting the cursor after the second O and pressing enter results in a line break?

martisak commented 6 years ago

The specific problem was solved by checking if the cursor is at the end of the view and aborting if it is. I am thinking this is a problem with Sublime, since if one checks the scope (by pressing Ctrl-Shift-P), the scope when the cursor is after the last character in "DONE" is different if the cursor is at the end of the view.

This also affects other things, for example pressing enter on a link when the cursor is after the last "]]" and also at the end of the view.

danielmagnussons commented 6 years ago

Yes, but also when I place cursor after "TODO", I can't do a new line, which means...annoying. =)

martisak commented 6 years ago

I see what you mean. Should be less annoying now..