mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 04:10:06 +08:00
Fix python runner (#3304)
* Add func to split shebang to commands * Fix python shebang check
This commit is contained in:
parent
a145a86215
commit
d1ba7d7cf2
@ -146,12 +146,17 @@ function! s:language_specified_mappings() abort
|
|||||||
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:Shebang_to_cmd(line) abort
|
||||||
|
let executable = matchstr(a:line, '#!\s*\zs[^ ]*')
|
||||||
|
let argvs = split(matchstr(a:line, '#!\s*[^ ]\+\s*\zs.*'))
|
||||||
|
return [executable] + argvs
|
||||||
|
endfunction
|
||||||
|
|
||||||
func! s:getexe() abort
|
func! s:getexe() abort
|
||||||
let line = getline(1)
|
let line = getline(1)
|
||||||
if line =~# '^#!'
|
if line =~# '^#!'
|
||||||
let exe = split(line)
|
return s:Shebang_to_cmd(line)
|
||||||
let exe[0] = exe[0][2:]
|
|
||||||
return exe
|
|
||||||
endif
|
endif
|
||||||
return ['python']
|
return ['python']
|
||||||
endf
|
endf
|
||||||
|
Loading…
Reference in New Issue
Block a user