@@ -5,7 +5,7 @@ let g:autoloaded_copilot_agent = 1
55
66scriptencoding utf- 8
77
8- let s: plugin_version = ' 1.7 .0'
8+ let s: plugin_version = ' 1.8 .0'
99
1010let s: error_exit = -1
1111
@@ -332,22 +332,8 @@ function! copilot#agent#LspHandle(agent_id, response) abort
332332 call s: OnResponse (s: instances [a: agent_id ], a: response )
333333endfunction
334334
335- unlet ! s: is_arm_macos
336- function ! s: IsArmMacOS () abort
337- if exists (' s:is_arm_macos' )
338- return s: is_arm_macos
339- elseif has (' win32' ) || ! isdirectory (' /private' )
340- let s: is_arm_macos = 0
341- else
342- let out = []
343- call copilot#job#Stream ([' uname' , ' -s' , ' -p' ], function (' add' , [out]), v: null )
344- let s: is_arm_macos = join (out, ' ' ) = ~# ' ^Darwin arm'
345- endif
346- return s: is_arm_macos
347- endfunction
348-
349335function ! s: Command () abort
350- if ! has (' nvim-0.6' ) && v: version < 802
336+ if ! has (' nvim-0.6' ) && v: version < 900
351337 return [v: null , ' ' , ' Vim version too old' ]
352338 endif
353339 let node = get (g: , ' copilot_node_command' , ' ' )
@@ -374,10 +360,8 @@ function! s:Command() abort
374360 if ! get (g: , ' copilot_ignore_node_version' )
375361 if major == 0
376362 return [v: null , node_version, ' Could not determine Node.js version' ]
377- elseif major < 16 && s: IsArmMacOS ()
363+ elseif major < 16
378364 return [v: null , node_version, ' Node.js version 16.x or newer required but found ' . node_version]
379- elseif major < 14
380- return [v: null , node_version, ' Node.js version 14.x or newer required but found ' . node_version]
381365 endif
382366 endif
383367 let agent = get (g: , ' copilot_agent_command' , ' ' )
@@ -410,9 +394,16 @@ function! copilot#agent#EditorInfo() abort
410394 else
411395 let proxy = ' '
412396 endif
413- let match = matchlist (proxy, ' \C ^\%([^:]\+://\)\=\%(\([^/:#]\+@\)\)\=\%(\([^/:#]\+\)\|\[\([[:xdigit:]:]\+\)\]\)\%(:\(\d\+\)\)\=\%(/\|$\)' )
397+ let match = matchlist (proxy, ' \c ^\%([^:]\+://\)\=\%(\([^/:#]\+@\)\)\=\%(\([^/:#]\+\)\|\[\([[:xdigit:]:]\+\)\]\)\%(:\(\d\+\)\)\=\%(/\|$\|?strict_\=ssl=\(.*\) \)' )
414398 if ! empty (match )
415399 let info.networkProxy = {' host' : match [2 ] . match [3 ], ' port' : empty (match [4 ]) ? 80 : + match [4 ]}
400+ if match [5 ] = ~? ' ^[0f]'
401+ let info.networkProxy.rejectUnauthorized = v: false
402+ elseif match [5 ] = ~? ' ^[1t]'
403+ let info.networkProxy.rejectUnauthorized = v: true
404+ elseif exists (' g:copilot_proxy_strict_ssl' )
405+ let info.networkProxy.rejectUnauthorized = empty (g: copilot_proxy_strict_ssl ) ? v: false : v: true
406+ endif
416407 if ! empty (match [1 ])
417408 let info.networkProxy.username = s: UrlDecode (matchstr (match [1 ], ' ^[^:]*' ))
418409 let info.networkProxy.password = s: UrlDecode (matchstr (match [1 ], ' :\zs.*' ))
0 commit comments