Skip to content

Commit 6c5abda

Browse files
committed
Copilot.vim 1.4.3
1 parent c2e75a3 commit 6c5abda

File tree

5 files changed

+29
-18
lines changed

5 files changed

+29
-18
lines changed

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ names into coding suggestions across dozens of languages.
88
Copilot.vim is a Vim plugin for GitHub Copilot. For now, it requires Neovim
99
0.6 (for virtual lines support) and a Node.js installation.
1010

11-
To learn more, visit [aka.ms/copilot-learn-more](https://aka.ms/copilot-learn-more)
11+
To learn more, visit
12+
[github.com/features/copilot](https://github.com/features/copilot).
1213

1314
## Subscription
1415

15-
Once GitHub Copilot is generally available, it will require a subscription. It
16-
will be free for verified students and maintainers of popular open source
17-
projects on GitHub.
16+
GitHub Copilot requires a subscription. It is free for verified students and
17+
maintainers of popular open source projects on GitHub.
1818

1919
## Getting started
2020

@@ -37,11 +37,7 @@ projects on GitHub.
3737
Suggestions are displayed inline and can be accepted by pressing the tab key.
3838
See `:help copilot` for more information.
3939

40-
During the technical preview, GitHub Copilot is considered a Beta Preview
41-
under the [GitHub Terms of
42-
Service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service#j-beta-previews).
43-
Once GitHub Copilot is generally available, it will be subject to the [GitHub
44-
Additional Product
40+
GitHub Copilot is subject to the [GitHub Additional Product
4541
Terms](https://docs.github.com/en/site-policy/github-terms/github-terms-for-additional-products-and-features).
4642

4743

autoload/copilot.vim

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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 ''
122122
endfunction
123123

124124
function! copilot#Dismiss() abort
125125
call copilot#Clear()
126+
call s:UpdatePreview()
126127
return ''
127128
endfunction
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
398403
endfunction
399404

400405
function! copilot#IsMapped() abort
@@ -428,6 +433,8 @@ endfunction
428433
function! copilot#OnCompleteChanged() abort
429434
if s:HideDuringCompletion()
430435
return copilot#Clear()
436+
else
437+
return copilot#Schedule()
431438
endif
432439
endfunction
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')
696703
endfunction
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'
699706
function! 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'

autoload/copilot/agent.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let g:autoloaded_copilot_agent = 1
55

66
scriptencoding utf-8
77

8-
let s:plugin_version = '1.4.2'
8+
let s:plugin_version = '1.4.3'
99

1010
let s:error_exit = -1
1111

copilot/dist/agent.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lua/_copilot.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ copilot.lsp_start_client = function(cmd, handler_names)
1313
end
1414
id = vim.lsp.start_client({
1515
cmd = cmd,
16+
cmd_cwd = vim.fn.expand('~'),
1617
name = 'copilot',
1718
handlers = handlers,
1819
get_language_id = function(bufnr, filetype)

0 commit comments

Comments
 (0)