mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:10:04 +08:00
Fix code runner encoding (#3184)
This commit is contained in:
parent
59fe4d4fde
commit
abe59e3d23
@ -11,6 +11,8 @@ let s:BUFFER = SpaceVim#api#import('vim#buffer')
|
||||
let s:STRING = SpaceVim#api#import('data#string')
|
||||
let s:FILE = SpaceVim#api#import('file')
|
||||
let s:VIM = SpaceVim#api#import('vim')
|
||||
let s:SYS = SpaceVim#api#import('system')
|
||||
let s:ICONV = SpaceVim#api#import('iconv')
|
||||
|
||||
|
||||
let s:runners = {}
|
||||
@ -259,7 +261,11 @@ if has('nvim') && exists('*chanclose')
|
||||
else
|
||||
let lines = s:_out_data
|
||||
endif
|
||||
if s:SYS.isWindows
|
||||
let lines = map(lines, 's:ICONV.iconv(v:val, "cp936", "utf-8")')
|
||||
endif
|
||||
if !empty(lines)
|
||||
let lines = map(lines, "substitute(v:val, '
$', '', 'g')")
|
||||
call s:BUFFER.buf_set_lines(s:bufnr, s:lines , s:lines + 1, 0, lines)
|
||||
call s:VIM.win_set_cursor(s:winid, [s:VIM.buf_line_count(s:bufnr), 1])
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user