Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7167958

Browse files
committed
Copilot.vim 1.47.0
1 parent8d1e0f8 commit7167958

File tree

7 files changed

+486
-499
lines changed

7 files changed

+486
-499
lines changed

‎autoload/copilot.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ function! s:SuggestionTextWithAdjustments() abort
211211
endif
212212
letdelete=strpart(line, offset, end_offset- offset)
213213
if typed=~#'^\s*$'
214-
let leading=matchstr(choice_text,'^\s\+')
214+
let leading=strpart(matchstr(choice_text,'^\s\+'),0,len(typed))
215215
let unindented=strpart(choice_text,len(leading))
216-
ifstrpart(typed,0,len(leading))== leading&& unindented!=#delete
216+
ifstrpart(typed,0,len(leading))==# leading&& unindented!=#delete
217217
return [unindented,len(typed)-len(leading),strchars(delete), choice]
218218
endif
219219
elseif typed==#strpart(choice_text,0, offset)

‎autoload/copilot/client.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ function! s:NvimClose() dict abort
469469
return
470470
endif
471471
letself.kill=v:true
472-
returnluaeval('vim.lsp.get_client_by_id(_A).stop()',self.client_id)
472+
returnluaeval('vim.lsp.stop_client(_A)',self.client_id)
473473
endfunction
474474

475475
function!s:NvimNotify(method, params)dictabort

‎autoload/copilot/panel.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ function! copilot#panel#Accept(...) abort
8686
endif
8787
letlines=split(item.insertText,"\n",1)
8888
let old_first=getbufline(state.bufnr, item.range.start.line+1)[0]
89-
letlines[0]=strpart(old_first,0,copilot#util#UTF16ToByteIdx(old_first, item.range.start.character)) .lines[0]
89+
let byte_offset_start=copilot#util#UTF16ToByteIdx(old_first, item.range.start.character)
90+
letlines[0]=strpart(old_first,0, byte_offset_start) .lines[0]
9091
let old_last=getbufline(state.bufnr, item.range.end.line+1)[0]
91-
letlines[-1].=strpart(old_last,copilot#util#UTF16ToByteIdx(old_last, item.range.end.character))
92+
let byte_offset_end=copilot#util#UTF16ToByteIdx(old_last, item.range.end.character)
93+
letlines[-1].=strpart(old_last, byte_offset_end)
9294
calldeletebufline(state.bufnr, item.range.start.line+1, item.range.end.line+1)
9395
callappendbufline(state.bufnr, item.range.start.line,lines)
9496
callcopilot#Request('workspace/executeCommand', item.command)

‎autoload/copilot/version.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
function!copilot#version#String()abort
2-
return'1.46.0'
2+
return'1.47.0'
33
endfunction

‎dist/main.js

Lines changed: 464 additions & 487 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎dist/main.js.map

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

‎lua/_copilot.lua

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ copilot.lsp_start_client = function(cmd, handler_names, opts, settings)
2828
if#workspace_folders==0then
2929
workspace_folders=nil
3030
end
31-
id= (vim.lsp.startorvim.lsp.start_client)({
31+
-- start_client() is deprecated, but the replacement start() breaks our
32+
-- restart workflow by returning the old client that's shutting down.
33+
-- https://github.com/neovim/neovim/issues/33616
34+
id=vim.lsp.start_client({
3235
cmd=cmd,
3336
cmd_cwd=vim.call('copilot#job#Cwd'),
3437
name='GitHub Copilot',
@@ -60,9 +63,14 @@ copilot.lsp_request = function(client_id, method, params, bufnr)
6063
bufnr=nil
6164
end
6265
local_,id
63-
_,id=client.request(method,params,function(err,result)
66+
localhandler=function(err,result)
6467
vim.call('copilot#client#LspResponse',client_id, {id=id,error=err,result=result })
65-
end,bufnr)
68+
end
69+
ifvim.fn.has('nvim-0.11')==1then
70+
_,id=client:request(method,params,handler,bufnr)
71+
else
72+
_,id=client.request(method,params,handler,bufnr)
73+
end
6674
returnid
6775
end
6876

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp