mirror of
https://github.com/dense-analysis/ale
synced 2025-02-18 13:26:49 +00:00
Use the proper term for the "#!" line
This commit is contained in:
parent
6c22936303
commit
73632312c2
@ -1,17 +1,17 @@
|
|||||||
" Author: w0rp <devw0rp@gmail.com>
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
|
|
||||||
function! ale#handlers#sh#GetShellType(buffer) abort
|
function! ale#handlers#sh#GetShellType(buffer) abort
|
||||||
let l:bang_line = get(getbufline(a:buffer, 1), 0, '')
|
let l:shebang = get(getbufline(a:buffer, 1), 0, '')
|
||||||
|
|
||||||
let l:command = ''
|
let l:command = ''
|
||||||
|
|
||||||
" Take the shell executable from the hashbang, if we can.
|
" Take the shell executable from the shebang, if we can.
|
||||||
if l:bang_line[:1] is# '#!'
|
if l:shebang[:1] is# '#!'
|
||||||
" Remove options like -e, etc.
|
" Remove options like -e, etc.
|
||||||
let l:command = substitute(l:bang_line, ' --\?[a-zA-Z0-9]\+', '', 'g')
|
let l:command = substitute(l:shebang, ' --\?[a-zA-Z0-9]\+', '', 'g')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" If we couldn't find a hashbang, try the filetype
|
" If we couldn't find a shebang, try the filetype
|
||||||
if l:command is# ''
|
if l:command is# ''
|
||||||
let l:command = &filetype
|
let l:command = &filetype
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user