Skip to content

Commit 00ccbaf

Browse files
committed
bugfix for folder and file complete abbr support
1 parent dce20a0 commit 00ccbaf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

autoload/easycomplete/sources/directory.vim

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ function! s:GetWrappedFileAndDirsList(rlist, fpath, base)
9595
return []
9696
endif
9797

98+
let dir_menu = g:easycomplete_menu_abbr ? '[Dir]' : 'folder'
99+
let file_menu = g:easycomplete_menu_abbr ? '[File]' : 'file'
100+
98101
if a:base[-1:] == "."
99102
let l:pfx = a:base
100103
else
@@ -106,17 +109,17 @@ function! s:GetWrappedFileAndDirsList(rlist, fpath, base)
106109
let localfile = simplify(a:fpath . '/' . item)
107110
if isdirectory(localfile)
108111
if g:easycomplete_nerd_font == 0
109-
call add(result_with_kind, {"word": item[strwidth(l:pfx):] . "/", "abbr":item, "menu" : "[Dir]"})
112+
call add(result_with_kind, {"word": item[strwidth(l:pfx):] . "/", "abbr":item, "menu" : dir_menu})
110113
else
111114
call add(result_with_kind, {"word": item[strwidth(l:pfx):] . "/", "abbr":item,
112-
\ "menu" : "folder", "kind": "" })
115+
\ "menu" : dir_menu, "kind": "" })
113116
endif
114117
else
115118
if g:easycomplete_nerd_font == 0
116-
call add(result_with_kind, {"word": item[strwidth(l:pfx):], "abbr":item,"menu" : "[File]"})
119+
call add(result_with_kind, {"word": item[strwidth(l:pfx):], "abbr":item,"menu" : file_menu})
117120
else
118121
call add(result_with_kind, {"word": item[strwidth(l:pfx):], "abbr": item,
119-
\ "menu" : "[file]",
122+
\ "menu" : file_menu,
120123
\ "kind": ""
121124
\ })
122125
endif

0 commit comments

Comments
 (0)