@@ -115,14 +115,15 @@ function! copilot#Clear() abort
115115 if exists (' b:_copilot' )
116116 call copilot#agent#Cancel (get (b: _copilot , ' first' , {}))
117117 call copilot#agent#Cancel (get (b: _copilot , ' cycling' , {}))
118- unlet b: _copilot
119118 endif
120119 call s: UpdatePreview ()
120+ unlet ! b: _copilot
121121 return ' '
122122endfunction
123123
124124function ! copilot#Dismiss () abort
125125 call copilot#Clear ()
126+ call s: UpdatePreview ()
126127 return ' '
127128endfunction
128129
@@ -394,7 +395,11 @@ function! s:Trigger(bufnr, timer) abort
394395 let g: _copilot_timer = timer_start (100 , function (' s:Trigger' , [a: bufnr ]))
395396 return
396397 endif
397- call copilot#Complete (function (' s:HandleTriggerResult' ), function (' s:HandleTriggerResult' ))
398+ try
399+ call copilot#Complete (function (' s:HandleTriggerResult' ), function (' s:HandleTriggerResult' ))
400+ catch
401+ call copilot#logger#Exception ()
402+ endtry
398403endfunction
399404
400405function ! copilot#IsMapped () abort
@@ -428,6 +433,8 @@ endfunction
428433function ! copilot#OnCompleteChanged () abort
429434 if s: HideDuringCompletion ()
430435 return copilot#Clear ()
436+ else
437+ return copilot#Schedule ()
431438 endif
432439endfunction
433440
@@ -695,7 +702,7 @@ function! s:commands.help(opts) abort
695702 return a: opts .mods . ' help ' . (len (a: opts .arg) ? ' :Copilot_' . a: opts .arg : ' copilot' )
696703endfunction
697704
698- let s: feedback_url = ' https://github.com/github/feedback /discussions/categories/copilot-feedback '
705+ let s: feedback_url = ' https://github.com/github-community/community /discussions/categories/copilot'
699706function ! s: commands .feedback (opts) abort
700707 echo s: feedback_url
701708 let browser = copilot#Browser ()
@@ -769,9 +776,16 @@ function! copilot#Command(line1, line2, range, bang, mods, arg) abort
769776 if ! empty (err)
770777 return ' echo ' . string (' Copilot: ' . string (err))
771778 endif
772- let opts = copilot#Call (' checkStatus' , {' options' : {' localChecksOnly' : v: true }})
779+ try
780+ let opts = copilot#Call (' checkStatus' , {' options' : {' localChecksOnly' : v: true }})
781+ catch
782+ call copilot#logger#Exception ()
783+ let opts = {' status' : ' VimException' }
784+ endtry
773785 if empty (cmd)
774- if opts.status !=# ' OK' && opts.status !=# ' MaybeOK'
786+ if opts.status == # ' VimException'
787+ return a: mods . ' split +$ ' . fnameescape (copilot#logger#File ())
788+ elseif opts.status !=# ' OK' && opts.status !=# ' MaybeOK'
775789 let cmd = ' setup'
776790 else
777791 let cmd = ' panel'
0 commit comments