blakesweeney / unite-taskwarrior

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

@context session wide #45

Closed linuxcaffe closed 9 years ago

linuxcaffe commented 9 years ago

While it makes sense that a utw session should not alter the context= variable, in taskrc, for fear of affecting sessions outside of vim, but having the context only apply to the next query, kind of defeats the purpose. Maybe the context setting could apply to the vim-session. An essential addition would be to always display the current in the status bar, even if it's @none.

linuxcaffe commented 9 years ago

oh, and although a leading "#" means "active" in a tasklist, I think the "@" is a more coherent indicator of active context, in :Unite taskwarrior/context

blakesweeney commented 9 years ago

I could probably add something like unite_taskwarrior_use_active_context to only list tasks, projects and tags in the current context. The context listing would be unaffected however. I'm also doing some work on improving the filter creation and the like. It might be better to add it there instead. What do you think?

linuxcaffe commented 9 years ago

The idea of @context implies a persistent filter until the @context is changed or cleared (@none) the ../contexts listing should be unaffected. Doing it in the filter-creation stage makes a lot of sense.

blakesweeney commented 9 years ago

This should be dealt with the latest version. There is a new filter generator and option. If you set g:unite_taskwarrior_respect_context = 1 then this should always list things that respect the current context. The exception being when using the context source to list tasks.

linuxcaffe commented 9 years ago

I must be doing something wrong,even with the rc-setting above, the context ain't sticky, and only has effect on the next command, from the /contexts source.

blakesweeney commented 9 years ago

Hmm. I'll look into this later today.

blakesweeney commented 9 years ago

So I added some test and fixed some bugs. I've been using respect context for a git and it seems to work for me. Could you describe what's not working?

linuxcaffe commented 9 years ago

still not working.. like this

:Unite /contexts (context is @none) select a different context, and I am shown a tasklist filtered by the new context try /notes invoke tasklist (:Unite taskwarrior) and I see all 184 tasks again! :Unite taskwarrior/contexts is back to @none

I am using the respect_context = 1 config

blakesweeney commented 9 years ago

Oh, ok I get what you meant. Right now what respect_context does is respect the externally set context. So if you set a context that has 10 tasks you should only see those 10 tasks when doing a task listing. It doesn't keep track of what goes on in your vim session. Right now there is an action called set for context source which will set the external context and open the task listing. This will do what you have in mind, but may not be the solution you are after. Is that what you want?

blakesweeney commented 9 years ago

So I've been thinking about this a bit. I don't really like the solution of having context that is internal to utw and doesn't effect taskwarrior itself. The context source does have a 'use' action which sets the context and should persist across queries. I would suggest using this. So I'm closing this issue, if you'd like a change in the defaults open another issue.