@@ -1717,9 +1717,9 @@ function! s:BadBoy.Vim(item, typing_word)
17171717 if &filetype != " vim" | return v: false | endif
17181718 let word = get (a: item , " label" , " " )
17191719 if empty (word) | return v: true | endif
1720- let pos = stridx (word, a: typing_word )
17211720 if len (a: typing_word ) == 1
1722- if pos >= 0 && pos <= 7
1721+ let pos = stridx (word, a: typing_word )
1722+ if pos >= 0 && pos <= 5
17231723 return v: false
17241724 else
17251725 return v: true
@@ -1838,11 +1838,15 @@ function! easycomplete#util#GetVimCompletionItems(response, plugin_name)
18381838 let l: items_length = len (l: items )
18391839 let typing_word = easycomplete#util#GetTypingWord ()
18401840 for l: completion_item in l: items
1841- if s: BadBoy .Nim (l: completion_item , typing_word) | continue | endif
1842- if s: BadBoy .Vim (l: completion_item , typing_word) | continue | endif
1843- if s: BadBoy .Dart (l: completion_item , typing_word) | continue | endif
1841+ if & filetype == " nim " && s: BadBoy .Nim (l: completion_item , typing_word) | continue | endif
1842+ if & filetype == " vim " && s: BadBoy .Vim (l: completion_item , typing_word) | continue | endif
1843+ if & filetype == " dart " && s: BadBoy .Dart (l: completion_item , typing_word) | continue | endif
18441844 let l: expandable = get (l: completion_item , ' insertTextFormat' , 1 ) == 2
1845- let l: lsp_type_obj = easycomplete#util#LspType (get (l: completion_item , ' kind' , 0 ))
1845+ if has_key (l: completion_item , " kind" )
1846+ let l: lsp_type_obj = easycomplete#util#LspType (l: completion_item [" kind" ])
1847+ else
1848+ let l: lsp_type_obj = easycomplete#util#LspType (0 )
1849+ endif
18461850 let l: menu_str = g: easycomplete_menu_abbr ? " [" . toupper (a: plugin_name ) ." ]" : l: lsp_type_obj [" fullname" ]
18471851 let l: vim_complete_item = {
18481852 \ ' kind' : get (l: lsp_type_obj , " symble" ),
0 commit comments