vim: fix count_threads variable check

It never really worked; in Ruby only 'nil' and 'false' evaluate to
false, therefore the statement '0 : true ? false' returns true, so it
doesn't matter if notmuch_folders_count_threads = 0, count_threads would
be true.

We need to check specifically if the value is 1 or 0.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
Felipe Contreras 2014-05-01 17:57:52 -05:00 committed by David Bremner
parent 697d6b5a47
commit 2fee62fd1f

View file

@ -633,7 +633,7 @@ ruby << EOF
def folders_render()
$curbuf.render do |b|
folders = VIM::evaluate('g:notmuch_folders')
count_threads = VIM::evaluate('g:notmuch_folders_count_threads')
count_threads = VIM::evaluate('g:notmuch_folders_count_threads') == 1
$searches.clear
folders.each do |name, search|
q = $curbuf.query(search)