X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=vim%2Fplugin%2Fnotmuch.vim;h=b328bcc658482ee122d4bb8d83681de4f4b34dd6;hp=dbe198539299364ced8f3bf8706af2ea1b273059;hb=72b7251d9aa766e1ee58f7f140de9a223ffe920c;hpb=dbd90c1fc72c4b26073524587db721a276607594 diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index dbe19853..b328bcc6 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -23,7 +23,7 @@ let s:notmuch_defaults = { \ 'g:notmuch_cmd': 'notmuch' , - \ 'g:notmuch_search_reverse': 1 , + \ 'g:notmuch_search_newest_first': 1 , \ 'g:notmuch_show_fold_signatures': 1 , \ 'g:notmuch_show_fold_citations': 1 , \ @@ -92,8 +92,10 @@ let g:notmuch_show_maps = { function! s:NM_cmd_search(words) let cmd = ['search'] - if g:notmuch_search_reverse - let cmd = cmd + ['--reverse'] + if g:notmuch_search_newest_first + let cmd = cmd + ['--sort=newest-first'] + else + let cmd = cmd + ['--sort=oldest-first'] endif let data = s:NM_run(cmd + a:words) "let data = substitute(data, '27/27', '25/27', '') @@ -181,7 +183,10 @@ function! s:NM_new_mail() endfunction function! s:NM_search_toggle_order() - echoe 'Not implemented' + let g:notmuch_search_newest_first = !g:notmuch_search_newest_first + " FIXME: maybe this would be better done w/o reading re-reading the lines + " reversing the b:nm_raw_lines and the buffer lines would be better + call NM_search_refresh_view() endfunction function! s:NM_search_reply_to_thread() @@ -198,6 +203,7 @@ endfunction function! s:NM_search_refresh_view() let lno = line('.') + setlocal bufhidden=delete call NM_cmd_search(b:nm_search_words) " FIXME: should find the line of the thread we were on if possible exec printf('norm %dG', lno)