aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-23 14:57:52 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-23 14:57:52 +1200
commit25989141c2ec675ce4b63fff6025776596c1ff5b (patch)
treed8148c9b94ed16ebe2cba7ef765f471c6651c6ef
parentMerge branch 'release/v4.41.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-25989141c2ec675ce4b63fff6025776596c1ff5b.tar.gz
dotfiles-25989141c2ec675ce4b63fff6025776596c1ff5b.zip
Merge branch 'release/v4.42.0'v4.42.0
* release/v4.42.0: Bump VERSION Delete blank lines at top of quoted reply Don't add spaces when quoting mail Make space appending for quote indent configurable Use get() for mail buffer variable fetch
-rw-r--r--VERSION4
-rw-r--r--vim/after/ftplugin/mail.vim11
-rw-r--r--vim/autoload/quote.vim19
3 files changed, 23 insertions, 11 deletions
diff --git a/VERSION b/VERSION
index 5646d84c..0c266a02 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v4.41.0
-Thu May 23 02:22:46 UTC 2019
+tejr dotfiles v4.42.0
+Thu May 23 02:57:52 UTC 2019
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index e01872d6..fd2c9705 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -1,3 +1,7 @@
+" Don't append spaces after quote chars, for strict compliance with
+" format=flowed
+let b:quote_space = 0
+
" If something hasn't already moved the cursor, we'll move to an optimal point
" to start writing
if line('.') == 1 && col('.') == 1
@@ -6,10 +10,17 @@ if line('.') == 1 && col('.') == 1
" no quote, which is fine
call search('\m^>', 'c')
+ " Delete quoted blank lines until we get to something with substance
+ while getline('.') =~# '^>\s*$'
+ delete
+ endwhile
+
" 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*$'
delete
+
+ " Delete quoted blank lines again
while getline('.') =~# '^>\s*$'
delete
endwhile
diff --git a/vim/autoload/quote.vim b/vim/autoload/quote.vim
index b84a87e8..616fd307 100644
--- a/vim/autoload/quote.vim
+++ b/vim/autoload/quote.vim
@@ -9,10 +9,9 @@ endfunction
" Quoting operator function
function! quote#QuoteOpfunc(type) abort
- " May as well make this configurable
- let char = exists('b:quote_char')
- \ ? b:quote_char
- \ : '>'
+ " Make character and space appending configurable
+ let char = get(b:, 'quote_char', '>')
+ let space = get(b:, 'quote_space', 1)
" Iterate over each matched line
for li in range(line('''['), line(''']'))
@@ -25,11 +24,13 @@ function! quote#QuoteOpfunc(type) abort
continue
endif
- " Only add a space after the quote character if this line isn't already
- " quoted with the same character
- let new = cur[0] == char
- \ ? char.cur
- \ : char.' '.cur
+ " If configured to do so, add a a space after the quote character, but
+ " only if this line isn't already quoted
+ let new = char
+ if l:space && cur[0] != char
+ let new .= ' '
+ endif
+ let new .= cur
call setline(li, new)
endfor