X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=vim%2Fplugin%2Fnotmuch.vim;h=b415f500a167619151afc3d623542a8aabb7efaa;hp=c5655617c862fcbd6da463c58fc0b3397ee4de08;hb=e6628e78d9ce3f9383a4699df9063a648617b428;hpb=7a215c2de81e95798ecadd982eecf05e647c3988 diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index c5655617..b415f500 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -114,7 +114,8 @@ let g:notmuch_folders_maps = { " --- --- bindings for search screen {{{2 let g:notmuch_search_maps = { - \ '': ':call NM_search_show_thread()', + \ '': ':call NM_search_show_thread(0)', + \ '': ':call NM_search_show_thread(1)', \ '': ':call NM_search_expand('''')', \ 'a': ':call NM_search_archive_thread()', \ 'f': ':call NM_search_filter()', @@ -266,17 +267,14 @@ endfunction " --- --- search screen action functions {{{2 -function! s:NM_search_show_thread() - let id = NM_search_thread_id() - if id != '' - let words = [id] - if exists('b:nm_search_words') - let words = ['('] + b:nm_search_words + [')', 'AND', id] - endif - if len(words) - call NM_cmd_show(words) - endif +function! s:NM_search_show_thread(everything) + let words = [ NM_search_thread_id() ] + if !a:everything && exists('b:nm_search_words') + call extend(words, ['AND', '(']) + call extend(words, b:nm_search_words) + call add(words, ')') endif + call NM_cmd_show(words) endfunction function! s:NM_search_prompt()