blakesweeney / unite-taskwarrior

A unite.vim interface to taskwarrior
6 stars 2 forks source link

new command :UniteTaskwarriorEditAnnotation #16

Closed linuxcaffe closed 9 years ago

linuxcaffe commented 9 years ago

Very recent changes to the 2.4.5 core taskwarrior code (like this week) and suddenly task can handle special characters in the stored JSON, like

\"  \/ \b \f \n \r \t \uXXXX

and this means that, as of last week, task has the capability of handling multi-line descriptions and annotations.

I'm not so sure about the usefulness of multi-line descriptions, but I AM quite sure that multi-line annotations would be VERY useful. This proposed new command UniteTaskwarriorEditAnnotation when invoked opens up a buffer for editing, special characters are converted, and when the buffer is saved, the newlines and/or tabs are converted to \n and \t respectively.

blakesweeney commented 9 years ago

This seems pretty useful. I wonder if taskwarrior is moving to have a tasknote like functionality built in. I'll work on adding such a command.

linuxcaffe commented 9 years ago

The core task devs are almost certainly not adding any such functionality, they are however moving to a completely renovated lexer and CLI engine. The changes will be almost invisible, but one of the happy side-effects is properly handling JSON special characters, and that means external projects will be able to do more fun stuff, like multi-line (built-in tasknote-like) annotations.

blakesweeney commented 9 years ago

Ok, that sounds cool. It seems that eventually I can remove the tasknote functionality from this and just use multiline annotations.

blakesweeney commented 9 years ago

So I've just pushed up a new branch that has some experimental code to handle this. Right now it will create a scratch buffer that one close will be turned into an annotation. Since current taskwarrior can't handle newlines and the like it turns newlines and tabs to spaces. You can try it out and let me know how it works. I've just tried a few simple tests and it seems to work. You can use it by selecting one or more tasks and hitting A in the taskwarrior listing. It should then annotate all tasks with that annotation.

linuxcaffe commented 9 years ago

The command exists! Changes required (if any, and there will be some) will be addressed in separate issues.