Skip to content

Commit c56bd82

Browse files
committed
Let ftdetect reset the filetype.
Fixes elixir-editors#133.
1 parent 64257e2 commit c56bd82

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ftdetect/elixir.vim

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ au FileType elixir,eelixir setl sw=2 sts=2 et iskeyword+=!,?
66
au BufNewFile,BufRead * call s:DetectElixir()
77

88
function! s:setf(filetype) abort
9-
if &filetype !=# a:filetype
10-
let &filetype = a:filetype
11-
endif
9+
let &filetype = a:filetype
1210
endfunction
1311

1412
function! s:DetectElixir()
15-
if getline(1) =~ '^#!.*\<elixir\>'
16-
call s:setf('elixir')
17-
endif
13+
if getline(1) =~ '^#!.*\<elixir\>'
14+
call s:setf('elixir')
15+
endif
1816
endfunction

0 commit comments

Comments
 (0)