[PATCH v2 1/3] vim: fix count_threads variable check
authorFelipe Contreras <felipe.contreras@gmail.com>
Thu, 1 May 2014 22:57:52 +0000 (17:57 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:02:02 +0000 (10:02 -0800)
13/de8cbcdd1947e82960361e1807d34b8f475af5 [new file with mode: 0644]

diff --git a/13/de8cbcdd1947e82960361e1807d34b8f475af5 b/13/de8cbcdd1947e82960361e1807d34b8f475af5
new file mode 100644 (file)
index 0000000..cd271f0
--- /dev/null
@@ -0,0 +1,90 @@
+Return-Path: <felipe.contreras@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id BBD08431FD7\r
+       for <notmuch@notmuchmail.org>; Thu,  1 May 2014 16:08:40 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id AbAmrGz9y3iO for <notmuch@notmuchmail.org>;\r
+       Thu,  1 May 2014 16:08:36 -0700 (PDT)\r
+Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com\r
+       [209.85.214.180]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 4A7B2431FBD\r
+       for <notmuch@notmuchmail.org>; Thu,  1 May 2014 16:08:36 -0700 (PDT)\r
+Received: by mail-ob0-f180.google.com with SMTP id va2so1668935obc.11\r
+       for <notmuch@notmuchmail.org>; Thu, 01 May 2014 16:08:35 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+       bh=iGLg/Mjy/e/1/U/MfzcdoIZ6drffq3OqwXD8u+Yl0k8=;\r
+       b=OY5VxL8OqS3cCt5wlw05VM95sD7UPBDtRqE0IrlSMsIvp7aUp/EC4wd7C+Xcgn71TS\r
+       4DSsXKPd1mPU/2AKEbs18T2eok1dZHRBMi0b6yCsYHlBD+DI7sQ1jGy1WvWJTWTUs48e\r
+       sV8aEAKajZE9/39wCAt1lPg8hX9QrCY/RFv1XK+6yG1XhZ714cX6pcJPGoiUTKOa+AKB\r
+       YTWDvRh4PLeCrpD2RFG5zeaHv9qfkNKuyxBR1dyvxB0ZRH4/QgZBr5B/Qc5nNhw4hJz0\r
+       ql5Ff8O7D/VPge6i2H2WMJNH1wYZv7B+P+kogGzk2i4Q5pGmxoHvJbi9hCe+WGeRlQWD\r
+       dTyA==\r
+X-Received: by 10.60.135.106 with SMTP id pr10mr13605871oeb.15.1398985715914; \r
+       Thu, 01 May 2014 16:08:35 -0700 (PDT)\r
+Received: from localhost (189-211-224-40.static.axtel.net. [189.211.224.40])\r
+       by mx.google.com with ESMTPSA id sm4sm62277852obc.3.2014.05.01.16.08.33\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Thu, 01 May 2014 16:08:34 -0700 (PDT)\r
+From: Felipe Contreras <felipe.contreras@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 1/3] vim: fix count_threads variable check\r
+Date: Thu,  1 May 2014 17:57:52 -0500\r
+Message-Id: <1398985074-17646-2-git-send-email-felipe.contreras@gmail.com>\r
+X-Mailer: git-send-email 1.9.2+fc1.19.g85b6256\r
+In-Reply-To: <1398985074-17646-1-git-send-email-felipe.contreras@gmail.com>\r
+References: <1398985074-17646-1-git-send-email-felipe.contreras@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 01 May 2014 23:08:41 -0000\r
+\r
+It never really worked; in Ruby only 'nil' and 'false' evaluate to\r
+false, therefore the statement '0 : true ? false' returns true, so it\r
+doesn't matter if notmuch_folders_count_threads = 0, count_threads would\r
+be true.\r
+\r
+We need to check specifically if the value is 1 or 0.\r
+\r
+Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\r
+---\r
+ vim/notmuch.vim | 2 +-\r
+ 1 file changed, 1 insertion(+), 1 deletion(-)\r
+\r
+diff --git a/vim/notmuch.vim b/vim/notmuch.vim\r
+index d7b310c..25a16e9 100644\r
+--- a/vim/notmuch.vim\r
++++ b/vim/notmuch.vim\r
+@@ -633,7 +633,7 @@ ruby << EOF\r
+       def folders_render()\r
+               $curbuf.render do |b|\r
+                       folders = VIM::evaluate('g:notmuch_folders')\r
+-                      count_threads = VIM::evaluate('g:notmuch_folders_count_threads')\r
++                      count_threads = VIM::evaluate('g:notmuch_folders_count_threads') == 1\r
+                       $searches.clear\r
+                       folders.each do |name, search|\r
+                               q = $curbuf.query(search)\r
+-- \r
+1.9.2+fc1.19.g85b6256\r
+\r