aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/filetype.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-14 17:39:39 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-14 17:39:39 +1200
commitf2802e7d8728deba266516b09114acf47357115b (patch)
tree7626d02864c503978cd6b51e35b15524025cde9d /vim/autoload/filetype.vim
parentMerge branch 'release/v6.0.0' into develop (diff)
downloaddotfiles-f2802e7d8728deba266516b09114acf47357115b.tar.gz
dotfiles-f2802e7d8728deba266516b09114acf47357115b.zip
Allow periods in sudo-ed filenames
Diffstat (limited to 'vim/autoload/filetype.vim')
-rw-r--r--vim/autoload/filetype.vim4
1 files changed, 2 insertions, 2 deletions
diff --git a/vim/autoload/filetype.vim b/vim/autoload/filetype.vim
index 79df3b28..6a66d62e 100644
--- a/vim/autoload/filetype.vim
+++ b/vim/autoload/filetype.vim
@@ -44,13 +44,13 @@ function! filetype#SudoRepeat() abort
let fn = expand('<afile>')
" myfileXXQGS16A.conf: strip eight chars before final period
- if fn =~# '/[^./]\+\w\{8}\.[^./]\+$'
+ if fn =~# '/[^/]\+\w\{8}\.[^./]\+$'
let fr = expand('<afile>:r')
let fe = expand('<afile>:e')
let fn = strpart(fr, -8, strlen(fr)) . '.' . fe
" myfile.XXQGS16A: strip extension
- elseif fn =~# '/[^./]\+\.\w\{8}$'
+ elseif fn =~# '/[^/]\+\.\w\{8}$'
let fn = expand('<afile>:r')
" Unrecognised pattern; return, don't repeat