1
0
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:
Bram Moolenaar
2023-06-22 12:18:57 +01:00
parent 545c8a506e
commit c12e4eecbb
3 changed files with 14 additions and 1 deletions

View File

@@ -1,5 +1,16 @@
" Test :setfiletype
func Test_backup_strip()
filetype on
let fname = 'Xdetect.js~~~~~~~~~~~'
call writefile(['one', 'two', 'three'], fname, 'D')
exe 'edit ' .. fname
call assert_equal('javascript', &filetype)
bwipe!
filetype off
endfunc
func Test_detection()
filetype on
augroup filetypedetect

View File

@@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1643,
/**/
1642,
/**/