aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim
diff options
context:
space:
mode:
authorGravatar Jason Woofenden <jason@jasonwoof.com>2011-07-11 01:40:10 -0400
committerGravatar Felipe Contreras <felipe.contreras@gmail.com>2011-07-16 21:57:38 +0300
commit8b10e4d56980037e388bf07c27899e34386c28f6 (patch)
tree62ce3b0c55b97f715cc2ead1ad4d2af4687bf27a /vim
parent6c6c8a9c8589ee0a56469e8d8e7a31bd038eb3ae (diff)
vim: fix citation/signature fold lengths
Before they'd often miss the last line Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Diffstat (limited to 'vim')
-rw-r--r--vim/plugin/notmuch.vim11
1 files changed, 7 insertions, 4 deletions
diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim
index f29dff1c..21985c71 100644
--- a/vim/plugin/notmuch.vim
+++ b/vim/plugin/notmuch.vim
@@ -747,8 +747,11 @@ function! s:NM_cmd_show_parse(inlines)
elseif mode_type == 'cit'
if part_end || match(line, g:notmuch_show_citation_regexp) == -1
let outlnum = len(info['disp'])
- let foldinfo = [ mode_type, mode_start, outlnum-1, len(info['msgs']),
- \ printf('[ %d-line citation. Press "c" to show. ]', outlnum - mode_start) ]
+ if !part_end
+ let outlnum = outlnum - 1
+ endif
+ let foldinfo = [ mode_type, mode_start, outlnum, len(info['msgs']),
+ \ printf('[ %d-line citation. Press "c" to show. ]', 1 + outlnum - mode_start) ]
let mode_type = ''
endif
elseif mode_type == 'sig'
@@ -756,8 +759,8 @@ function! s:NM_cmd_show_parse(inlines)
if (outlnum - mode_start) > g:notmuch_show_signature_lines_max
let mode_type = ''
elseif part_end
- let foldinfo = [ mode_type, mode_start, outlnum-1, len(info['msgs']),
- \ printf('[ %d-line signature. Press "i" to show. ]', outlnum - mode_start) ]
+ let foldinfo = [ mode_type, mode_start, outlnum, len(info['msgs']),
+ \ printf('[ %d-line signature. Press "i" to show. ]', 1 + outlnum - mode_start) ]
let mode_type = ''
endif
endif