Closed Kythonlk closed 6 days ago
I got this, too.
Same
Bug caused by 9fa0dee67051d8e5d334f7f607e6bab1d6a46d1a, reverting to decfb541c9fd176f467991dcde8923c7db362e02 fixes things.
This happens when there are no completions. If there's no ghost text, this error will appear. Will add some guards for that case.
If you see this happening under other conditions, let us know.
This happens when there are no completions. If there's no ghost text, this error will appear. Will add some guards for that case.
If you see this happening under other conditions, let us know.
i am not even getting ghost text, pressing the key unnecessarily showed me that the plugin was loaded
When you get a chance, please pull the repo and test it. Let us know.
If you are using the latest commit and are still encountering issues, the workaround of removing the ~/.codeium/code_tracker
directory (e.g. rm -rf ~/.codeium/code_tracker
) fixes the issues for me.
make the following changes to file autoload/codeium.vim, works for me now:
function! codeium#Accept() abort
let current_completion = s:GetCurrentCompletionItem()
return s:CompletionInserter(current_completion, current_completion is v:null ? '' : current_completion.completion.text)
endfunction
function! codeium#AcceptNextWord() abort
let current_completion = s:GetCurrentCompletionItem()
let completion_parts = current_completion is v:null ? [] : get(current_completion, 'completionParts', [])
if len(completion_parts) == 0
return ''
endif
let prefix_text = get(completion_parts[0], 'prefix', '')
let completion_text = get(completion_parts[0], 'text', '')
let next_word = matchstr(completion_text, '\v^\W*\k*')
return s:CompletionInserter(current_completion, prefix_text . next_word)
endfunction
function! codeium#AcceptNextLine() abort
let current_completion = s:GetCurrentCompletionItem()
let text = current_completion is v:null ? '' : substitute(current_completion.completion.text, '\v\n.*$', '', '')
return s:CompletionInserter(current_completion, text)
endfunction
make the following changes to file autoload/codeium.vim, works for me now:
function! codeium#Accept() abort let current_completion = s:GetCurrentCompletionItem() return s:CompletionInserter(current_completion, current_completion is v:null ? '' : current_completion.completion.text) endfunction function! codeium#AcceptNextWord() abort let current_completion = s:GetCurrentCompletionItem() let completion_parts = current_completion is v:null ? [] : get(current_completion, 'completionParts', []) if len(completion_parts) == 0 return '' endif let prefix_text = get(completion_parts[0], 'prefix', '') let completion_text = get(completion_parts[0], 'text', '') let next_word = matchstr(completion_text, '\v^\W*\k*') return s:CompletionInserter(current_completion, prefix_text . next_word) endfunction function! codeium#AcceptNextLine() abort let current_completion = s:GetCurrentCompletionItem() let text = current_completion is v:null ? '' : substitute(current_completion.completion.text, '\v\n.*$', '', '') return s:CompletionInserter(current_completion, text) endfunction
Would you send a pull request?
@fortenforge This one was also be fixed
This error fixed and now working well
in insert mode if i press next arrow key it will enter "-1" then give error msg
This is my lazy vim plugin config to codeium.
return { { "Exafunction/codeium.vim", event = "BufEnter", config = function() vim.keymap.set("i", "", function()
return vim.fn["codeium#Accept"]()
end, { expr = true, silent = true })
vim.keymap.set("i", "<c-;>", function()
return vim.fn"codeium#CycleCompletions"
end, { expr = true, silent = true })
vim.keymap.set("i", "<c-,>", function()
return vim.fn"codeium#CycleCompletions"
end, { expr = true, silent = true })
vim.keymap.set("i", "", function()
return vim.fn["codeium#Clear"]()
end, { expr = true, silent = true })
end,
},
}
os: Manjaro 6.6 (Arch) neovim : v11
Originally posted by @Kythonlk in https://github.com/Exafunction/codeium.vim/issues/380#issuecomment-2164622414