unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] vim: preserve the 'show everything' flag when finding next/prev buffer
@ 2009-11-28  2:31 Bart Trojanowski
  2009-12-03 21:31 ` Carl Worth
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Trojanowski @ 2009-11-28  2:31 UTC (permalink / raw)
  To: notmuch; +Cc: Bart Trojanowski

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 <Space>, <C-n> and <C-p>.

Signed-off-by: Bart Trojanowski <bart@jukie.net>
---
 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 <SID>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 <SID>NM_kill_this_buffer()
         if line('.') > 1
                 norm k
-                call <SID>NM_search_show_thread()
+                call <SID>NM_search_show_thread(everything)
                 norm G
                 call <SID>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 <SID>NM_kill_this_buffer()
         if line('.') != line('$')
                 norm j
-                call <SID>NM_search_show_thread()
+                call <SID>NM_search_show_thread(everything)
         else
                 echo 'No more messages.'
         endif
-- 
1.6.4.4.2.gc2f148

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] vim: preserve the 'show everything' flag when finding next/prev buffer
  2009-11-28  2:31 [PATCH] vim: preserve the 'show everything' flag when finding next/prev buffer Bart Trojanowski
@ 2009-12-03 21:31 ` Carl Worth
  2009-12-03 22:13   ` Bart Trojanowski
  0 siblings, 1 reply; 3+ messages in thread
From: Carl Worth @ 2009-12-03 21:31 UTC (permalink / raw)
  To: Bart Trojanowski, notmuch; +Cc: Bart Trojanowski

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

On Fri, 27 Nov 2009 21:31:12 -0500, Bart Trojanowski <bart@jukie.net> wrote:
> 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 <Space>, <C-n> and <C-p>.

Hi Bart,

Sorry I missed this with your earlier, related changes. But I've pushed
this now.

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] vim: preserve the 'show everything' flag when finding next/prev buffer
  2009-12-03 21:31 ` Carl Worth
@ 2009-12-03 22:13   ` Bart Trojanowski
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Trojanowski @ 2009-12-03 22:13 UTC (permalink / raw)
  To: Carl Worth; +Cc: notmuch

* Carl Worth <cworth@cworth.org> [091203 16:31]:
> Sorry I missed this with your earlier, related changes. But I've pushed
> this now.

Thanks.

-Bart

-- 
				WebSig: http://www.jukie.net/~bart/sig/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-03 22:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-28  2:31 [PATCH] vim: preserve the 'show everything' flag when finding next/prev buffer Bart Trojanowski
2009-12-03 21:31 ` Carl Worth
2009-12-03 22:13   ` Bart Trojanowski

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).