aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-17 15:59:39 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-17 15:59:39 +1200
commita9e59520d7efade3aeed9977cc64b32004af7dcb (patch)
tree60e323e2f45c2964966e366ea1ce47d38d945151 /vim/autoload
parent4826ac2858d02df0ebd5f4e25abb4b18805cbfcc (diff)
parentd24d4d32fb384c5a35dfa0f01c8da2d156386c98 (diff)
downloaddotfiles-a9e59520d7efade3aeed9977cc64b32004af7dcb.tar.gz
dotfiles-a9e59520d7efade3aeed9977cc64b32004af7dcb.zip
Merge branch 'release/v1.33.0'v1.33.0
* release/v1.33.0: Bump VERSION Add handling for older sh.vim syntax g:is_posix Add my own ftplugin for awk Don't quote first and last lines of range if blank
Diffstat (limited to 'vim/autoload')
-rw-r--r--vim/autoload/quote.vim9
1 files changed, 8 insertions, 1 deletions
diff --git a/vim/autoload/quote.vim b/vim/autoload/quote.vim
index 26e95698..35df76a4 100644
--- a/vim/autoload/quote.vim
+++ b/vim/autoload/quote.vim
@@ -17,9 +17,16 @@ function! quote#QuoteOpfunc(type) abort
" Iterate over each matched line
for l:li in range(line('''['), line(''']'))
+ " Get current line text
+ let l:cur = getline(l:li)
+
+ " Don't quote the first or last lines if they're blank
+ if !strlen(l:cur) && (l:li == line('''[') || l:li == line(''']'))
+ continue
+ endif
+
" Only add a space after the quote character if this line isn't already
" quoted with the same character
- let l:cur = getline(l:li)
let l:new = stridx(l:cur, l:char) == 0
\ ? l:char.l:cur
\ : l:char.' '.l:cur