From 83fc0188ba1f1b81f76f5fa5ffa1f218e2d29fe0 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 30 Apr 2022 20:56:58 +0800 Subject: [PATCH] fix(curl): use bundle curl instead of windows's --- bundle/vim-chat/autoload/chat/gitter.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bundle/vim-chat/autoload/chat/gitter.vim b/bundle/vim-chat/autoload/chat/gitter.vim index 7ce716e32..a6c68f810 100644 --- a/bundle/vim-chat/autoload/chat/gitter.vim +++ b/bundle/vim-chat/autoload/chat/gitter.vim @@ -191,7 +191,14 @@ endfunction function! chat#gitter#send(room, msg) abort let roomid = s:room_to_roomid(a:room) - let cmd = ['curl', '-X', 'POST', '-H', 'Content-Type: application/json', '-H', 'Accept: application/json', + " the win 11 curl in system32/ directory do not support unicode, use + " neovim's curl + if has('nvim') && exists('v:progpath') && (has('win64') || has('win32')) + let curl = fnamemodify(v:progpath, ':h') . '\curl.exe' + else + let curl = 'curl' + endif + let cmd = [curl, '-X', 'POST', '-H', 'Content-Type: application/json', '-H', 'Accept: application/json', \ '-H', 'Authorization: Bearer ' . g:chat_gitter_token, \ printf('https://api.gitter.im/v1/rooms/%s/chatMessages', roomid), \ '-d',