From 43cfdab6088fb4cefb2b3a7d443f1479e0e29f8a Mon Sep 17 00:00:00 2001 From: Bart Trojanowski Date: Fri, 27 Nov 2009 09:35:49 -0500 Subject: [PATCH] vim: have '?' show search words in search mode --- vim/plugin/notmuch.vim | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index 95e9c98c..d406a7eb 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -127,7 +127,7 @@ let g:notmuch_search_maps = { \ '+': ':call NM_search_add_tags([])', \ '-': ':call NM_search_remove_tags([])', \ '=': ':call NM_search_refresh_view()', - \ '?': ':echo NM_search_thread_id()', + \ '?': ':echo NM_search_thread_id() . '' @ '' . join(NM_get_search_words())', \ } " --- --- bindings for show screen {{{2 @@ -157,7 +157,7 @@ let g:notmuch_show_maps = { \ \ 'r': ':call NM_show_reply()', \ 'm': ':call NM_new_mail()', - \ '?': ':echo NM_show_message_id() . '' @ '' . join(NM_show_search_words())', + \ '?': ':echo NM_show_message_id() . '' @ '' . join(NM_get_search_words())', \ } " --- --- bindings for compose screen {{{2 @@ -419,7 +419,7 @@ function! s:NM_cmd_show(words) setlocal bufhidden=hide call NM_newBuffer('', 'show', join(info['disp'], "\n")) setlocal bufhidden=delete - let b:nm_words = a:words + let b:nm_search_words = a:words let b:nm_raw_info = info let b:nm_prev_bufnr = prev_bufnr @@ -628,13 +628,6 @@ function! s:NM_show_message_id() return '' endfunction -function! s:NM_show_search_words() - if !exists('b:nm_words') - throw 'Eeek! no b:nm_words' - endif - return b:nm_words -endfunction - function! s:NM_show_fold_toggle(key, type, fold) let info = b:nm_raw_info let act = 'open' @@ -1227,6 +1220,13 @@ endfunction " --- other helpers {{{1 +function! s:NM_get_search_words() + if !exists('b:nm_search_words') + throw 'Eeek! no b:nm_search_words' + endif + return b:nm_search_words +endfunction + function! s:NM_kill_this_buffer() if exists('b:nm_prev_bufnr') let prev_bufnr = b:nm_prev_bufnr -- 2.26.2