diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-14 17:39:39 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-14 17:39:39 +1200 |
commit | f2802e7d8728deba266516b09114acf47357115b (patch) | |
tree | 7626d02864c503978cd6b51e35b15524025cde9d | |
parent | Merge branch 'release/v6.0.0' into develop (diff) | |
download | dotfiles-f2802e7d8728deba266516b09114acf47357115b.tar.gz dotfiles-f2802e7d8728deba266516b09114acf47357115b.zip |
Allow periods in sudo-ed filenames
-rw-r--r-- | vim/autoload/filetype.vim | 4 |
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 |