mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 00:50:05 +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
|
||||
|
||||
|
||||
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
|
||||
let line = getline(1)
|
||||
if line =~# '^#!'
|
||||
let exe = split(line)
|
||||
let exe[0] = exe[0][2:]
|
||||
return exe
|
||||
return s:Shebang_to_cmd(line)
|
||||
endif
|
||||
return ['python']
|
||||
endf
|
||||
|
Loading…
Reference in New Issue
Block a user