Skip to content

Commit 185aee6

Browse files
mikoto2000prabirshrestha
authored andcommitted
Allowing empty word complete item (#378)
* Modify to allowing empty word complete item. * Fix test.
1 parent fe50576 commit 185aee6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

autoload/lsp/omni.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ function! lsp#omni#get_vim_completion_item(item, ...) abort
193193
\ 'info': '',
194194
\ 'icase': 1,
195195
\ 'dup': 1,
196+
\ 'empty': 1,
196197
\ 'kind': l:kind}
197198

198199
" check support user_data.
@@ -254,7 +255,7 @@ function! s:apply_text_edit() abort
254255
endif
255256

256257
" completion faild or not select complete item
257-
if empty(v:completed_item) || v:completed_item['word'] ==# ''
258+
if empty(v:completed_item)
258259
return
259260
endif
260261

test/lsp/omni.vimspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Describe lsp#omni
1414
\ 'info': 'my documentation.',
1515
\ 'icase': 1,
1616
\ 'dup': 1,
17+
\ 'empty': 1,
1718
\ 'kind': 'function',
1819
\ 'menu': 'my-detail'
1920
\}
@@ -55,6 +56,7 @@ Describe lsp#omni
5556
\ 'info': 'my documentation.',
5657
\ 'icase': 1,
5758
\ 'dup': 1,
59+
\ 'empty': 1,
5860
\ 'kind': 'function',
5961
\ 'menu': 'my-detail',
6062
\ 'user_data': l:want_user_data_string
@@ -83,6 +85,7 @@ Describe lsp#omni
8385
\ 'info': 'my documentation.',
8486
\ 'icase': 1,
8587
\ 'dup': 1,
88+
\ 'empty': 1,
8689
\ 'kind': 'function',
8790
\ 'menu': 'my-detail',
8891
\}

0 commit comments

Comments
 (0)