From 6e83eb640f4f92dac7a4856dfeeec611bc19ac03 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 19:27:36 +1200 Subject: Ensure we're in body text before breaking quotes --- vim/after/ftplugin/mail.vim | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'vim/after') 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 -- cgit v1.2.3