@@ -30,6 +30,7 @@ local function complete(prefix, cmp_start, items)
30
30
elseif entry1_under < entry2_under then
31
31
return true
32
32
end
33
+ return false
33
34
end )
34
35
35
36
vim .fn .complete (cmp_start + 1 , items )
@@ -150,6 +151,14 @@ local function complete_changed(args)
150
151
local cur_info = vim .fn .complete_info ()
151
152
local selected = cur_info .selected
152
153
154
+ if
155
+ M .config .border
156
+ and cur_info .preview_winid
157
+ and vim .api .nvim_win_is_valid (cur_info .preview_winid )
158
+ then
159
+ vim .api .nvim_win_set_config (cur_info .preview_winid , { border = M .config .border })
160
+ end
161
+
153
162
util .debounce (state .entries .info , M .config .debounce_delay , function ()
154
163
local completion_item = vim .tbl_get (cur_item , ' user_data' , ' nvim' , ' lsp' , ' completion_item' )
155
164
if not completion_item then
@@ -175,7 +184,7 @@ local function complete_changed(args)
175
184
end
176
185
177
186
local info = vim .fn .complete_info ()
178
- if not info .items or not info .selected or not info .selected = = selected then
187
+ if not info .items or not info .selected or info .selected ~ = selected then
179
188
return
180
189
end
181
190
@@ -195,6 +204,7 @@ local function complete_changed(args)
195
204
end
196
205
197
206
M .config = {
207
+ border = nil , -- Documentation border style
198
208
entry_mapper = nil , -- Custom completion entry mapper
199
209
debounce_delay = 100 ,
200
210
}
@@ -227,6 +237,9 @@ function M.setup(config)
227
237
if not client then
228
238
return
229
239
end
240
+ if not vim .lsp .completion or not vim .lsp .completion .enable then
241
+ return
242
+ end
230
243
vim .lsp .completion .enable (true , client .id , event .buf , { autotrigger = false })
231
244
end ,
232
245
})
0 commit comments