diff options
Diffstat (limited to 'autoload/shebang_change_filetype.vim')
-rw-r--r-- | autoload/shebang_change_filetype.vim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/autoload/shebang_change_filetype.vim b/autoload/shebang_change_filetype.vim index 081eaf1..447ac2b 100644 --- a/autoload/shebang_change_filetype.vim +++ b/autoload/shebang_change_filetype.vim @@ -1,7 +1,8 @@ " Check whether the first line was changed and looks like a shebang, and if " so, re-run filetype detection -function! shebang_change_filetype#Check() abort - if line('''[') == 1 && getline(1) =~# '^#!' +function! shebang_change_filetype#() abort + if line("'[") == 1 + \ && strpart(getline(1), 0, 2) ==# '#!' doautocmd filetypedetect BufRead endif endfunction |