unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] Add an option to hide the saved search query, disabled by default.
@ 2019-03-22 16:20 Nicolas Lesser
  0 siblings, 0 replies; only message in thread
From: Nicolas Lesser @ 2019-03-22 16:20 UTC (permalink / raw)
  To: notmuch

---
 vim/notmuch.vim | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index ad8b7c80..2c6b471f 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -60,6 +60,7 @@ let s:notmuch_reader_default = 'mutt -f %s'
 let s:notmuch_sendmail_default = 'sendmail'
 let s:notmuch_folders_count_threads_default = 0
 let s:notmuch_compose_start_insert_default = 1
+let s:notmuch_hide_saved_search_query = 0
 
 function! s:new_file_buffer(type, fname)
 	exec printf('edit %s', a:fname)
@@ -437,6 +438,10 @@ function! s:set_defaults()
 		let g:notmuch_compose_start_insert = s:notmuch_compose_start_insert_default
 	endif
 
+	if !exists('g:notmuch_hide_saved_search_query')
+		let g:notmuch_hide_saved_search_query = s:notmuch_hide_saved_search_query
+	endif
+
 	if !exists('g:notmuch_custom_search_maps') && exists('g:notmuch_rb_custom_search_maps')
 		let g:notmuch_custom_search_maps = g:notmuch_rb_custom_search_maps
 	endif
@@ -645,7 +650,11 @@ ruby << EOF
 				}
 				$searches << search
 				count = count_threads ? q.count_threads : q.count_messages
-				b << "%9d %-20s (%s)" % [count, name, search]
+				if VIM::evaluate('g:notmuch_hide_saved_search_query') == 1
+					b << "%9d %-20s" % [count, name]
+				else
+					b << "%9d %-20s (%s)" % [count, name, search]
+				end
 			end
 		end
 	end
-- 
2.21.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-22 16:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-22 16:20 [PATCH] Add an option to hide the saved search query, disabled by default Nicolas Lesser

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).