@@ -89,15 +89,12 @@ endfunction
89
89
90
90
function ! codeium#Accept () abort
91
91
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)
93
93
endfunction
94
94
95
95
function ! codeium#AcceptNextWord () abort
96
96
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' , [])
101
98
if len (completion_parts) == 0
102
99
return ' '
103
100
endif
@@ -109,10 +106,7 @@ endfunction
109
106
110
107
function ! codeium#AcceptNextLine () abort
111
108
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.*$' , ' ' , ' ' )
116
110
return s: CompletionInserter (current_completion, text)
117
111
endfunction
118
112
0 commit comments