Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 82B57431FBC for ; Fri, 27 Nov 2009 18:32:09 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2uSyNBCN5lRU for ; Fri, 27 Nov 2009 18:32:08 -0800 (PST) Received: from tau.jukie.net (tau.jukie.net [216.239.93.128]) by olra.theworths.org (Postfix) with ESMTP id 6EB86431FAE for ; Fri, 27 Nov 2009 18:32:08 -0800 (PST) Received: from localhost.localdomain (oxygen.jukie.net [10.10.10.8]) by tau.jukie.net (Postfix) with ESMTP id D5856C008F5; Fri, 27 Nov 2009 21:32:07 -0500 (EST) From: Bart Trojanowski To: notmuch@notmuchmail.org Date: Fri, 27 Nov 2009 21:31:12 -0500 Message-Id: <1259375472-29968-1-git-send-email-bart@jukie.net> X-Mailer: git-send-email 1.6.4.4.2.gc2f148 Cc: Bart Trojanowski Subject: [notmuch] [PATCH] vim: preserve the 'show everything' flag when finding next/prev buffer X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 02:32:09 -0000 When show mode is invoked it could be displaying just the matched messages or everything. This flag is passed to NM_search_show_thread(). It is then stored in a buffer variable, b:nm_show_everything, and used for subsequent calls to NM_search_show_thread() triggered by , and . Signed-off-by: Bart Trojanowski --- vim/plugin/notmuch.vim | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index b415f50..34d70d9 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -275,6 +275,7 @@ function! s:NM_search_show_thread(everything) call add(words, ')') endif call NM_cmd_show(words) + let b:nm_show_everything = a:everything endfunction function! s:NM_search_prompt() @@ -430,6 +431,7 @@ function! s:NM_cmd_show(words) endfunction function! s:NM_show_previous(can_change_thread, find_matching) + let everything = exists('b:nm_show_everything') ? b:nm_show_everything : 0 let info = b:nm_raw_info let lnum = line('.') for msg in reverse(copy(info['msgs'])) @@ -450,7 +452,7 @@ function! s:NM_show_previous(can_change_thread, find_matching) call NM_kill_this_buffer() if line('.') > 1 norm k - call NM_search_show_thread() + call NM_search_show_thread(everything) norm G call NM_show_previous(0, a:find_matching) else @@ -479,10 +481,11 @@ function! s:NM_show_next(can_change_thread, find_matching) endfunction function! s:NM_show_next_thread() + let everything = exists('b:nm_show_everything') ? b:nm_show_everything : 0 call NM_kill_this_buffer() if line('.') != line('$') norm j - call NM_search_show_thread() + call NM_search_show_thread(everything) else echo 'No more messages.' endif -- 1.6.4.4.2.gc2f148