Skip to content

Commit 590d6ea

Browse files
authored
fix(Exafunction#381): handle when there are no completions (Exafunction#382)
Will no error nor insert anything when the functions are called and there are no completions yet.
1 parent 9fa0dee commit 590d6ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

autoload/codeium.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ endfunction
9494

9595
function! codeium#AcceptNextWord() abort
9696
let current_completion = s:GetCurrentCompletionItem()
97+
if current_completion is v:null
98+
return ''
99+
endif
97100
let completion_parts = get(current_completion, 'completionParts', [])
98101
if len(completion_parts) == 0
99102
return ''
@@ -106,6 +109,9 @@ endfunction
106109

107110
function! codeium#AcceptNextLine() abort
108111
let current_completion = s:GetCurrentCompletionItem()
112+
if current_completion is v:null
113+
return ''
114+
endif
109115
let text = substitute(current_completion.completion.text, '\v\n.*$', '', '')
110116
return s:CompletionInserter(current_completion, text)
111117
endfunction

0 commit comments

Comments
 (0)