diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-06 11:40:20 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-06 11:45:33 +1300 |
commit | f9e95b30a6dedb5f09ef904ae5d1993cd2d6115a (patch) | |
tree | 7703988f50a95a7d0d938ccad7f015fd9c509a10 | |
parent | Remove redundant has('eval') VimL test (diff) | |
download | dotfiles-f9e95b30a6dedb5f09ef904ae5d1993cd2d6115a.tar.gz dotfiles-f9e95b30a6dedb5f09ef904ae5d1993cd2d6115a.zip |
Restore some judicious \m\C hedging in Vim
These are technically not really needed, but this is more consistent
with good style recommendations in the Google VimScript style guide.
-rw-r--r-- | vim/plugin/strip_trailing_whitespace.vim | 4 | ||||
-rw-r--r-- | vim/plugin/toggle_option_flag.vim | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/vim/plugin/strip_trailing_whitespace.vim b/vim/plugin/strip_trailing_whitespace.vim index 677e51c5..d5f5624a 100644 --- a/vim/plugin/strip_trailing_whitespace.vim +++ b/vim/plugin/strip_trailing_whitespace.vim @@ -30,11 +30,11 @@ function! s:StripTrailingWhitespace() " Replace the line with a subsitution of its text stripping extraneous " whitespace - call setline(l:li, substitute(l:line, '\s\+$', '', 'g')) + call setline(l:li, substitute(l:line, '\m\C\s\+$', '', 'g')) " If this line has any non-whitespace characters on it, update l:lw with " its index - if l:line =~# '\S' + if l:line =~# '\m\S' let l:lw = l:li endif diff --git a/vim/plugin/toggle_option_flag.vim b/vim/plugin/toggle_option_flag.vim index cbe8035e..b63e0eb8 100644 --- a/vim/plugin/toggle_option_flag.vim +++ b/vim/plugin/toggle_option_flag.vim @@ -18,13 +18,13 @@ let g:loaded_toggle_option_flag = 1 function! s:Toggle(option, flag, local) " Check for weird options, we don't want to :execute anything funny - if a:option =~# '[^a-z]' + if a:option =~# '\m[^a-z]' echoerr 'Illegal option name' return endif " Weird flags, too; should be a single inoffensive char - if a:flag !~# '^[a-z0-9.]$' + if a:flag !~# '\m^[a-z0-9.]$' echoerr 'Illegal flag' return endif |