aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vim/after/ftplugin/mail.vim14
1 files changed, 4 insertions, 10 deletions
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index f4a4c91d..1cc3fd14 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -49,19 +49,13 @@ let b:undo_ftplugin .= '|delcommand SuggestStart'
SuggestStart
" Normalise quoting
-function! s:StrictQuote() abort
+function! s:StrictQuote(start, end) abort
let body = 0
- for lnum in range(1, line('$'))
+ for lnum in range(a:start, a:end)
" 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)
@@ -77,8 +71,8 @@ function! s:StrictQuote() abort
endfor
endfunction
-command -bar -buffer StrictQuote
- \ call s:StrictQuote()
+command -buffer -bar -range=% StrictQuote
+ \ call s:StrictQuote(<q-line1>, <q-line2>)
let b:undo_ftplugin .= '|delcommand StrictQuote'
StrictQuote