From: Bart Trojanowski Date: Sun, 22 Nov 2009 05:16:25 +0000 (-0500) Subject: vim: ingore would-be-folds with line count of 1 or fewer X-Git-Tag: 0.1~313^2~58 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=251ec73587e92f386c9d24bc781bad38a70e3afb vim: ingore would-be-folds with line count of 1 or fewer --- diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index 3bb9d363..15252d2d 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -542,10 +542,8 @@ 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']) - if mode_start != outlnum - let foldinfo = [ mode_type, mode_start, outlnum-1, - \ printf('[ %d-line citation. Press "c" to show. ]', outlnum - mode_start) ] - endif + let foldinfo = [ mode_type, mode_start, outlnum-1, + \ printf('[ %d-line citation. Press "c" to show. ]', outlnum - mode_start) ] let mode_type = '' endif elseif mode_type == 'sig' @@ -553,10 +551,8 @@ function! s:NM_cmd_show_parse(inlines) if (outlnum - mode_start) > g:notmuch_show_signature_lines_max let mode_type = '' elseif part_end - if mode_start != outlnum - let foldinfo = [ mode_type, mode_start, outlnum-1, - \ printf('[ %d-line signature. Press "s" to show. ]', outlnum - mode_start) ] - endif + let foldinfo = [ mode_type, mode_start, outlnum-1, + \ printf('[ %d-line signature. Press "s" to show. ]', outlnum - mode_start) ] let mode_type = '' endif endif @@ -565,7 +561,7 @@ function! s:NM_cmd_show_parse(inlines) if part_end " FIXME: this is a hack for handling two folds being added for one line " we should handle addinga fold in a function - if len(foldinfo) + if len(foldinfo) && foldinfo[1] < foldinfo[2] call add(info['folds'], foldinfo[0:2]) let info['foldtext'][foldinfo[1]] = foldinfo[3] endif @@ -665,7 +661,7 @@ function! s:NM_cmd_show_parse(inlines) endif endif - if len(foldinfo) + if len(foldinfo) && foldinfo[1] < foldinfo[2] call add(info['folds'], foldinfo[0:2]) let info['foldtext'][foldinfo[1]] = foldinfo[3] endif