From: Bartosz Date: Sat, 10 Jan 2015 12:03:02 +0000 (+0100) Subject: [PATCH 2/4] VIM: move backward trough messages in thread mode X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f3a13c5c3ae27a3d2265615b0dfccce74d687ba6;p=notmuch-archives.git [PATCH 2/4] VIM: move backward trough messages in thread mode --- diff --git a/64/bfceca52eb62d8634581e592636ae267f6fc69 b/64/bfceca52eb62d8634581e592636ae267f6fc69 new file mode 100644 index 000000000..cb8f1b33b --- /dev/null +++ b/64/bfceca52eb62d8634581e592636ae267f6fc69 @@ -0,0 +1,89 @@ +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 62C45429E4F + for ; Sat, 10 Jan 2015 04:03:40 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] 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 KuOE09vqfUVj for ; + Sat, 10 Jan 2015 04:03:36 -0800 (PST) +Received: from smtp.webfaction.com (mail6.webfaction.com [74.55.86.74]) + by olra.theworths.org (Postfix) with ESMTP id CD80F429E40 + for ; Sat, 10 Jan 2015 04:03:34 -0800 (PST) +Received: from localhost (87-231-242-54.rev.numericable.fr [87.231.242.54]) + by smtp.webfaction.com (Postfix) with ESMTP id 152C12078836; + Sat, 10 Jan 2015 12:03:30 +0000 (UTC) +From: Bartosz +To: notmuch@notmuchmail.org +Subject: [PATCH 2/4] VIM: move backward trough messages in thread mode +Date: Sat, 10 Jan 2015 13:03:02 +0100 +Message-Id: <1420891384-992-3-git-send-email-telenczuk@unic.cnrs-gif.fr> +X-Mailer: git-send-email 1.9.3 (Apple Git-50) +In-Reply-To: <1420891384-992-1-git-send-email-telenczuk@unic.cnrs-gif.fr> +References: <1420891384-992-1-git-send-email-telenczuk@unic.cnrs-gif.fr> +X-Mailman-Approved-At: Sat, 10 Jan 2015 10:22:24 -0800 +Cc: Bartosz +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: Sat, 10 Jan 2015 12:03:40 -0000 + +--- + vim/notmuch.vim | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/vim/notmuch.vim b/vim/notmuch.vim +index 34d4f92..4f90d79 100644 +--- a/vim/notmuch.vim ++++ b/vim/notmuch.vim +@@ -39,7 +39,8 @@ let g:notmuch_show_maps = { + \ 'p': 'show_save_patches()', + \ 'r': 'show_reply()', + \ '?': 'show_info()', +- \ '': 'show_next_msg()', ++ \ '': 'show_next_msg(1)', ++ \ '': 'show_next_msg(-1)', + \ 'c': 'compose()', + \ } + +@@ -114,15 +115,18 @@ EOF + call s:kill_this_buffer() + endfunction + +-function! s:show_next_msg() ++function! s:show_next_msg(inc) + ruby << EOF ++ inc = VIM::evaluate('a:inc') + r, c = $curwin.cursor + n = $curbuf.line_number + i = $messages.index { |m| n >= m.start && n <= m.end } +- m = $messages[i + 1] +- if m ++ m = $messages[i + inc] ++ if m and !((i + inc)<0) + r = m.body_start + 1 ++ VIM::command("normal zM") + VIM::command("normal #{m.start}zt") ++ VIM::command("normal zo") + $curwin.cursor = r, c + end + EOF +-- +1.9.3 (Apple Git-50) +