@@ -89,15 +89,12 @@ endfunction
8989
9090function ! codeium#Accept () abort
9191 let current_completion = s: GetCurrentCompletionItem ()
92- return s: CompletionInserter (current_completion, current_completion.completion.text)
92+ return s: CompletionInserter (current_completion, current_completion is v: null ? ' ' : current_completion .completion.text)
9393endfunction
9494
9595function ! codeium#AcceptNextWord () abort
9696 let current_completion = s: GetCurrentCompletionItem ()
97- if current_completion is v: null
98- return ' '
99- endif
100- let completion_parts = get (current_completion, ' completionParts' , [])
97+ let completion_parts = current_completion is v: null ? [] : get (current_completion, ' completionParts' , [])
10198 if len (completion_parts) == 0
10299 return ' '
103100 endif
@@ -109,10 +106,7 @@ endfunction
109106
110107function ! codeium#AcceptNextLine () abort
111108 let current_completion = s: GetCurrentCompletionItem ()
112- if current_completion is v: null
113- return ' '
114- endif
115- let text = substitute (current_completion.completion.text, ' \v\n.*$' , ' ' , ' ' )
109+ let text = current_completion is v: null ? ' ' : substitute (current_completion.completion.text, ' \v\n.*$' , ' ' , ' ' )
116110 return s: CompletionInserter (current_completion, text)
117111endfunction
118112
0 commit comments