aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--VERSION4
-rw-r--r--vim/after/ftplugin/mail.vim19
m---------vim/bundle/squeeze_repeat_blanks0
3 files changed, 15 insertions, 8 deletions
diff --git a/VERSION b/VERSION
index c5461ba3..99088ef8 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v4.39.0
-Wed May 22 23:24:50 UTC 2019
+tejr dotfiles v4.40.0
+Thu May 23 02:18:08 UTC 2019
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index 15277f7b..0145f0aa 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -8,7 +8,7 @@ if line('.') == 1 && col('.') == 1
" Check this line to see if it's a generic hello or hello-name greeting that
" we can just strip out; delete any following lines too, if they're blank
- if getline('.') =~? '^>\s*\%(<hello\|hey\+\|hi\)\(\s\+\S\+\)\=[,;]*\s*$'
+ if getline('.') =~? '^>\s*\%(<hello\|hey\+\|hi\)\%(\s\+\S\+\)\=[,;]*\s*$'
delete
while getline('.') =~# '^>\s*$'
delete
@@ -32,8 +32,8 @@ for lnum in range(1, line('$'))
break
endif
- " Normalise the quote with no intermediate and one trailing space
- let quote = substitute(quote, '[^>]', '', 'g').' '
+ " Normalise the quote with no spaces
+ let quote = substitute(quote, '[^>]', '', 'g')
" Re-set the line
let line = substitute(line, '^[> \t]\+', quote, '')
@@ -45,12 +45,19 @@ endfor
setlocal formatoptions+=w
let b:undo_ftplugin .= '|setlocal formatoptions<'
-" Define what constitutes a 'blank line' for the squeeze_repeat_blanks.vim
-" plugin, if loaded, to include leading quotes and spaces, and then do it
+" Mail-specific handling for custom vim-squeeze-repeat-blanks plugin
if exists('loaded_squeeze_repeat_blanks')
+
+ " Set the blank line pattern
let b:squeeze_repeat_blanks_blank = '^[ >]*$'
let b:undo_ftplugin .= '|unlet b:squeeze_repeat_blanks_blank'
- silent SqueezeRepeatBlanks
+
+ " If there is anything quoted in this message (i.e. it looks like a reply),
+ " squeeze blanks, but don't report lines deleted
+ if search('\m^>', 'cnw')
+ silent SqueezeRepeatBlanks
+ endif
+
endif
" Stop here if the user doesn't want ftplugin mappings
diff --git a/vim/bundle/squeeze_repeat_blanks b/vim/bundle/squeeze_repeat_blanks
-Subproject 6cd99a9510897e87fba76721b3c9d148c51a164
+Subproject c0b376f4b38cd748652f388f7a86c7a37be358a