vim: fix citation/signature fold lengths

Before they'd often miss the last line

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
Jason Woofenden 2011-07-11 01:40:10 -04:00 committed by Felipe Contreras
parent 6c6c8a9c85
commit 8b10e4d569

View file

@ -747,8 +747,11 @@ function! s:NM_cmd_show_parse(inlines)
elseif mode_type == 'cit' elseif mode_type == 'cit'
if part_end || match(line, g:notmuch_show_citation_regexp) == -1 if part_end || match(line, g:notmuch_show_citation_regexp) == -1
let outlnum = len(info['disp']) let outlnum = len(info['disp'])
let foldinfo = [ mode_type, mode_start, outlnum-1, len(info['msgs']), if !part_end
\ printf('[ %d-line citation. Press "c" to show. ]', outlnum - mode_start) ] 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 = '' let mode_type = ''
endif endif
elseif mode_type == 'sig' 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 if (outlnum - mode_start) > g:notmuch_show_signature_lines_max
let mode_type = '' let mode_type = ''
elseif part_end elseif part_end
let foldinfo = [ mode_type, mode_start, outlnum-1, len(info['msgs']), let foldinfo = [ mode_type, mode_start, outlnum, len(info['msgs']),
\ printf('[ %d-line signature. Press "i" to show. ]', outlnum - mode_start) ] \ printf('[ %d-line signature. Press "i" to show. ]', 1 + outlnum - mode_start) ]
let mode_type = '' let mode_type = ''
endif endif
endif endif