aboutsummaryrefslogtreecommitdiff
path: root/vim/after
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-14 19:27:36 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-14 19:27:36 +1200
commit6e83eb640f4f92dac7a4856dfeeec611bc19ac03 (patch)
tree09f7629472366b26afc0de75e58d24a973395155 /vim/after
parent13d56c5d0f0af692914a7f39673da357d6e50213 (diff)
downloaddotfiles-6e83eb640f4f92dac7a4856dfeeec611bc19ac03.tar.gz
dotfiles-6e83eb640f4f92dac7a4856dfeeec611bc19ac03.zip
Ensure we're in body text before breaking quotes
Diffstat (limited to 'vim/after')
-rw-r--r--vim/after/ftplugin/mail.vim7
1 files changed, 7 insertions, 0 deletions
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index cba446a3..fd67bc51 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -39,11 +39,18 @@ if line('.') == 1 && col('.') == 1
endif
" Normalise quoting
+let body = 0
for lnum in range(1, line('$'))
" Get current line
let line = getline(lnum)
+ " Skip lines until we hit a blank line, meaning body text
+ let body = body || !strlen(line)
+ if !body
+ continue
+ endif
+
" Get the leading quote string, if any; skip if there isn't one
let quote = matchstr(line, '^>[> ]*')
if strlen(quote) == 0