diff options
author | Bart Trojanowski <bart@jukie.net> | 2009-11-22 00:16:25 -0500 |
---|---|---|
committer | Bart Trojanowski <bart@jukie.net> | 2009-11-25 00:48:54 -0500 |
commit | 251ec73587e92f386c9d24bc781bad38a70e3afb (patch) | |
tree | 52097e7cd9b4f738f1167cfe070f3a9577bde196 /vim | |
parent | dda6b7eb1c5a75dc31595376212d0e30c5fd61ed (diff) |
vim: ingore would-be-folds with line count of 1 or fewer
Diffstat (limited to 'vim')
-rw-r--r-- | vim/plugin/notmuch.vim | 16 |
1 files changed, 6 insertions, 10 deletions
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 |