forked from aniani/vim
patch 9.0.1643: filetype detection fails if file name ends in many '~'
Problem: Filetype detection fails if file name ends in many '~'. Solution: Strip multiple '~' at the same time. (closes #12553)
This commit is contained in:
@@ -21,7 +21,7 @@ au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-ol
|
||||
\ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r"))
|
||||
au BufNewFile,BufRead *~
|
||||
\ let s:name = expand("<afile>") |
|
||||
\ let s:short = substitute(s:name, '\~$', '', '') |
|
||||
\ let s:short = substitute(s:name, '\~\+$', '', '') |
|
||||
\ if s:name != s:short && s:short != "" |
|
||||
\ exe "doau filetypedetect BufRead " . fnameescape(s:short) |
|
||||
\ endif |
|
||||
|
||||
Reference in New Issue
Block a user