Skip to content

Commit

Permalink
Fix systemlist carriage return on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rbong committed Oct 26, 2024
1 parent 6f80c1f commit afbbe41
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions autoload/flog/shell.vim
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@ function! flog#shell#EscapeList(list) abort
endfunction

function! flog#shell#Systemlist(cmd) abort
let l:cmd = a:cmd
if type(a:cmd) == v:t_list
return systemlist(join(a:cmd, ' '))
let l:cmd = join(l:cmd, ' ')
endif
return systemlist(a:cmd)
if has('win32')
let l:result = split(system(l:cmd), '\n\r\?', 1)
if empty(l:result[-1])
return l:result[:-2]
endif
return l:result
endif
return systemlist(l:cmd)
endfunction

function! flog#shell#Run(cmd) abort
Expand Down

0 comments on commit afbbe41

Please sign in to comment.