From e6628e78d9ce3f9383a4699df9063a648617b428 Mon Sep 17 00:00:00 2001 From: Bart Trojanowski Date: Fri, 27 Nov 2009 18:02:05 -0500 Subject: [PATCH] vim: use more consistently in search view In search view will show the thead, but folding messages that don't match the current search expression. Conversly, always shows all messages in the thread. --- vim/README | 3 ++- vim/plugin/notmuch.vim | 20 +++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/vim/README b/vim/README index 299c7f89..8cd3b1a2 100644 --- a/vim/README +++ b/vim/README @@ -42,7 +42,8 @@ Buffer types: You are presented with the search results when you run :NotMuch. Keybindings: - - show the selected message + - show the selected thread colapsing unmatched items + - show the entire selected thread a - archive message (remove inbox tag) f - filter the current search terms o - toggle search screen order 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()