blakesweeney / unite-taskwarrior

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

< BkSpc > = a "back button" #14

Closed linuxcaffe closed 9 years ago

linuxcaffe commented 9 years ago

when changing reports, from one listing, to a tag list, to a project detail (info) display, I often find I'd like to return to the previous list, but then I have to re-envoke the sequence. A command-history and using the BACKSPACE key, might make that navigation easier (possible).

linuxcaffe commented 9 years ago

vimwiki also uses the BACKSPACE to back through link history.. for what it's worth ;-)

blakesweeney commented 9 years ago

The issue with this is that unite doesn't provide this functionality and I'm not sure it provides the information to make it possible. I don't know if it gives me enough information to know what source was opened with what options (vertical split, what filter, etc). I'll look into it, as I can see it's usefulness but I can't promise anything.

blakesweeney commented 9 years ago

So I've looked into this a bit and unite provides :UniteResume which opens the previous unite buffer. It opens everything exactly as it was which is great! Sadly, it does not work to open the previous if you already have one open so we can't reuse it. But unite does at least provide all the info so it should be possible to implement your request.

blakesweeney commented 9 years ago

I've made some progress on this issue. Take a look at the latest commit. This adds a previous action which will open up the previous unite buffer. Right now it only exists in the taskwarrior source (which I should fix I think). It seems to work ok for me. For some reason I can't add bindings for it within the plugin but if you add something like:

nnoremap <silent><buffer><expr> <BS>  unite#do_action('previous')

to ftplugin/unite.vim you will be able to use backspace to go back. Let me know how it works for you.

blakesweeney commented 9 years ago

This is now mapped for the taskwarrior source. I will add it to all sources and that should take care of this issue.

linuxcaffe commented 9 years ago

wow!

linuxcaffe commented 9 years ago

good progress here, but in testing it, iI hit

[unite.vim] function unite#action#do..367, line 3
[unite.vim] Vim(call):E716: Key not present in Dictionary: start.func(past[0])
[unite.vim] Error occurred while executing "previous" action!
blakesweeney commented 9 years ago

What source did this happen in?

linuxcaffe commented 9 years ago

I don't remember, I'll try to reproduce..

linuxcaffe commented 9 years ago

happened again, from a tasklist, hit BkSpc

linuxcaffe commented 9 years ago

and from a /notes source, (and others) BkSpc throws

Error detected while processing function unite#action#do..143_get_candidates_action_table..unite#util#print_error:
line    2:
E714: List required
E714: List required
blakesweeney commented 9 years ago

I took a look at this and it seems to work for notes now. I've used it in most other sources and all seems to be well. Let me know if you run into this issue some more.

linuxcaffe commented 9 years ago

Much less annoying! thanks!