Skip to content

Commit 38d9e4b

Browse files
committed
update
1 parent ad102c7 commit 38d9e4b

2 files changed

Lines changed: 15 additions & 18 deletions

File tree

autoload/copilot.vim

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,11 @@ function! copilot#Complete(...) abort
249249
endif
250250
let params = copilot#doc#Params()
251251
if !exists('b:_copilot.params') || b:_copilot.params !=# params
252-
let b:_copilot = {'params': params, 'first':
253-
\ copilot#Request('getCompletions', params)}
252+
let b:_copilot = {'params': params, 'cycling':
253+
\ copilot#Request('getCompletionsCycling', params)}
254254
let g:_copilot_last = b:_copilot
255255
endif
256-
let completion = b:_copilot.first
256+
let completion = b:_copilot.cycling
257257
if !a:0
258258
return completion.Await()
259259
else
@@ -410,7 +410,6 @@ endfunction
410410

411411
function! s:ClearPreview() abort
412412
if exists('*nvim_buf_del_extmark')
413-
call nvim_buf_del_extmark(0, copilot#NvimNs(), 1)
414413
endif
415414
endfunction
416415

@@ -444,8 +443,6 @@ function! s:UpdatePreview() abort
444443
let data.virt_text += annot
445444
endif
446445
let data.hl_mode = 'combine'
447-
call nvim_buf_del_extmark(0, copilot#NvimNs(), 1)
448-
call nvim_buf_set_extmark(0, copilot#NvimNs(), line('.')-1, col('.')-1, data)
449446
if uuid !=# get(s:, 'uuid', '')
450447
let s:uuid = uuid
451448
call copilot#Request('notifyShown', {'uuid': uuid})
@@ -471,7 +468,7 @@ function! s:Trigger(bufnr, timer) abort
471468
return
472469
endif
473470
if exists('s:auth_request')
474-
let g:_copilot_timer = timer_start(100, function('s:Trigger', [a:bufnr]))
471+
let g:_copilot_timer = timer_start(50, function('s:Trigger', [a:bufnr]))
475472
return
476473
endif
477474
call copilot#Complete(function('s:HandleTriggerResult'), function('s:HandleTriggerResult'))
@@ -488,7 +485,7 @@ function! copilot#Schedule(...) abort
488485
if !s:is_mapped || !s:dest || !copilot#Enabled()
489486
return
490487
endif
491-
let delay = a:0 ? a:1 : get(g:, 'copilot_idle_delay', 75)
488+
let delay = a:0 ? a:1 : get(g:, 'copilot_idle_delay', 50)
492489
let g:_copilot_timer = timer_start(delay, function('s:Trigger', [bufnr('')]))
493490
endfunction
494491

autoload/copilot/agent.vim

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -300,16 +300,16 @@ function! s:Command() abort
300300
endif
301301
let node_version = matchstr(join(out, ''), '^v\zs\d\+\.[^[:space:]]*')
302302
let major = str2nr(node_version)
303-
let too_new = major >= 18 && node_version !=# '18.0.0'
304-
if !get(g:, 'copilot_ignore_node_version')
305-
if major == 0
306-
return [v:null, 'Could not determine Node.js version']
307-
elseif (major < 16 || too_new) && s:IsArmMacOS()
308-
return [v:null, 'Node.js version 16.x or 17.x required on Apple Silicon but found ' . node_version]
309-
elseif major < 12 || too_new
310-
return [v:null, 'Node.js version 12.x–17.x required but found ' . node_version]
311-
endif
312-
endif
303+
" let too_new = major >= 18 && node_version !=# '18.0.0'
304+
" if !get(g:, 'copilot_ignore_node_version')
305+
" if major == 0
306+
" return [v:null, 'Could not determine Node.js version']
307+
" elseif (major < 16 || too_new) && s:IsArmMacOS()
308+
" return [v:null, 'Node.js version 16.x or 17.x required on Apple Silicon but found ' . node_version]
309+
" elseif major < 12 || too_new
310+
" return [v:null, 'Node.js version 12.x–17.x required but found ' . node_version]
311+
" endif
312+
" endif
313313
let agent = s:root . '/copilot/dist/agent.js'
314314
if !filereadable(agent)
315315
let agent = get(g:, 'copilot_agent_command', '')

0 commit comments

Comments
 (0)