From: Felipe Contreras Date: Thu, 1 May 2014 22:57:52 +0000 (+1900) Subject: [PATCH v2 1/3] vim: fix count_threads variable check X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8d4d677da7e66ea27e9c08c728e693d1efade205;p=notmuch-archives.git [PATCH v2 1/3] vim: fix count_threads variable check --- diff --git a/13/de8cbcdd1947e82960361e1807d34b8f475af5 b/13/de8cbcdd1947e82960361e1807d34b8f475af5 new file mode 100644 index 000000000..cd271f0eb --- /dev/null +++ b/13/de8cbcdd1947e82960361e1807d34b8f475af5 @@ -0,0 +1,90 @@ +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 BBD08431FD7 + for ; Thu, 1 May 2014 16:08:40 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +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 AbAmrGz9y3iO for ; + Thu, 1 May 2014 16:08:36 -0700 (PDT) +Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com + [209.85.214.180]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 4A7B2431FBD + for ; Thu, 1 May 2014 16:08:36 -0700 (PDT) +Received: by mail-ob0-f180.google.com with SMTP id va2so1668935obc.11 + for ; Thu, 01 May 2014 16:08:35 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=iGLg/Mjy/e/1/U/MfzcdoIZ6drffq3OqwXD8u+Yl0k8=; + b=OY5VxL8OqS3cCt5wlw05VM95sD7UPBDtRqE0IrlSMsIvp7aUp/EC4wd7C+Xcgn71TS + 4DSsXKPd1mPU/2AKEbs18T2eok1dZHRBMi0b6yCsYHlBD+DI7sQ1jGy1WvWJTWTUs48e + sV8aEAKajZE9/39wCAt1lPg8hX9QrCY/RFv1XK+6yG1XhZ714cX6pcJPGoiUTKOa+AKB + YTWDvRh4PLeCrpD2RFG5zeaHv9qfkNKuyxBR1dyvxB0ZRH4/QgZBr5B/Qc5nNhw4hJz0 + ql5Ff8O7D/VPge6i2H2WMJNH1wYZv7B+P+kogGzk2i4Q5pGmxoHvJbi9hCe+WGeRlQWD + dTyA== +X-Received: by 10.60.135.106 with SMTP id pr10mr13605871oeb.15.1398985715914; + Thu, 01 May 2014 16:08:35 -0700 (PDT) +Received: from localhost (189-211-224-40.static.axtel.net. [189.211.224.40]) + by mx.google.com with ESMTPSA id sm4sm62277852obc.3.2014.05.01.16.08.33 + for + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Thu, 01 May 2014 16:08:34 -0700 (PDT) +From: Felipe Contreras +To: notmuch@notmuchmail.org +Subject: [PATCH v2 1/3] vim: fix count_threads variable check +Date: Thu, 1 May 2014 17:57:52 -0500 +Message-Id: <1398985074-17646-2-git-send-email-felipe.contreras@gmail.com> +X-Mailer: git-send-email 1.9.2+fc1.19.g85b6256 +In-Reply-To: <1398985074-17646-1-git-send-email-felipe.contreras@gmail.com> +References: <1398985074-17646-1-git-send-email-felipe.contreras@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Thu, 01 May 2014 23:08:41 -0000 + +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 +--- + vim/notmuch.vim | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/vim/notmuch.vim b/vim/notmuch.vim +index d7b310c..25a16e9 100644 +--- a/vim/notmuch.vim ++++ b/vim/notmuch.vim +@@ -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) +-- +1.9.2+fc1.19.g85b6256 +