Skip to content

Commit

Permalink
fix(#381): handle when there are no completions (#382)
Browse files Browse the repository at this point in the history
Will no error nor insert anything when the functions are called and
there are no completions yet.
  • Loading branch information
LeonardoMor authored Jun 13, 2024
1 parent 9fa0dee commit 590d6ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions autoload/codeium.vim
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ endfunction

function! codeium#AcceptNextWord() abort
let current_completion = s:GetCurrentCompletionItem()
if current_completion is v:null
return ''
endif
let completion_parts = get(current_completion, 'completionParts', [])
if len(completion_parts) == 0
return ''
Expand All @@ -106,6 +109,9 @@ endfunction

function! codeium#AcceptNextLine() abort
let current_completion = s:GetCurrentCompletionItem()
if current_completion is v:null
return ''
endif
let text = substitute(current_completion.completion.text, '\v\n.*$', '', '')
return s:CompletionInserter(current_completion, text)
endfunction
Expand Down

1 comment on commit 590d6ea

@tamilanmkv
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this issue has not been fixed please change it, or else its never return \t

  if current_completion is v:null
    return default
  endif

Please sign in to comment.