summaryrefslogtreecommitdiffstats
path: root/runtime/filetype.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-06-22 12:18:57 +0100
committerBram Moolenaar <Bram@vim.org>2023-06-22 12:18:57 +0100
commitc12e4eecbb26cedca96e0810d3501043356eebaa (patch)
treedf92ab784d4d1dac888fad47e6dbc1e7bfb75eac /runtime/filetype.vim
parent545c8a506e7e0921ded7eb7ffe3518279cbcb16a (diff)
patch 9.0.1643: filetype detection fails if file name ends in many '~'v9.0.1643
Problem: Filetype detection fails if file name ends in many '~'. Solution: Strip multiple '~' at the same time. (closes #12553)
Diffstat (limited to 'runtime/filetype.vim')
-rw-r--r--runtime/filetype.vim2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index c93ce5eaeb..9daf5a3cbb 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -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 |