diff options
author | Jason Woofenden <jason@jasonwoof.com> | 2011-07-11 01:40:09 -0400 |
---|---|---|
committer | Felipe Contreras <felipe.contreras@gmail.com> | 2011-07-16 21:57:38 +0300 |
commit | 6c6c8a9c8589ee0a56469e8d8e7a31bd038eb3ae (patch) | |
tree | 599ff2902aa704a5e686a75b7cd6f39b634c4dda /vim | |
parent | 3de487d405f7bf57e959d58ae856afcce6e277fe (diff) |
vim: fix (hack) cig/cit parsing within multipart/*
The vim front-end isn't written to handle nested parts.
This patch doesn't change that, it just changes the code to pretend that
multipart/* sections end immediately. This makes the parsing code think that
all sections are top-level, and are thus parsed well enough.
The lovely result of this is that citation folds and signature folds now work
in text/plain parts that are within multipart/* sections. Also, all mime
section starts are now shown correctly (before some were not parsed and showed
the ugly ^L and an ID and so on from notmuch.)
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Diffstat (limited to 'vim')
-rw-r--r-- | vim/plugin/notmuch.vim | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index 4ad992be..f29dff1c 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -796,7 +796,14 @@ function! s:NM_cmd_show_parse(inlines) endif call add(info['disp'], \ printf('--- %s ---', in_part)) - let part_start = len(info['disp']) + 1 + " We don't yet handle nested parts, so pop + " multipart/* immediately so text/plain + " sub-parts are parsed properly + if match(in_part, '^multipart/') != -1 + let in_part = '' + else + let part_start = len(info['disp']) + 1 + endif endif elseif in_header |