Skip to content

Commit

Permalink
bugfix #219
Browse files Browse the repository at this point in the history
  • Loading branch information
jayli committed Dec 4, 2023
1 parent b5409a9 commit 9adca42
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ Typing `:h easycomplete` for help.

It support keywords/dictionary/directory completion by default.

Disable directory completion via `let g:easycomplete_directory_enable = 0`.

#### Semantic Completion for Other Languages

There are tow ways to install lsp server.
Expand Down
4 changes: 4 additions & 0 deletions autoload/easycomplete/sources/directory.vim
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ function! easycomplete#sources#directory#completor(opt, ctx)
endfunction

function! s:CompleteHandler(typing, name, ctx, startcol, typing_path)
if g:easycomplete_directory_enable == 0
call easycomplete#complete(a:name, a:ctx, a:startcol, [])
return
endif
let spath_start = a:typing_path.short_path_start
try
let result = s:GetDirAndFiles(a:typing_path, a:ctx['typing'])
Expand Down
4 changes: 4 additions & 0 deletions plugin/easycomplete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ endif
if !exists("g:easycomplete_tabnine_enable")
let g:easycomplete_tabnine_enable = 1
endif
if !exists("g:easycomplete_directory_enable")
let g:easycomplete_directory_enable = 1
endif
if !exists("g:easycomplete_tabnine_config")
let g:easycomplete_tabnine_config = {}
endif
Expand Down Expand Up @@ -157,6 +160,7 @@ let g:easycomplete_config = {
\ 'g:easycomplete_tabnine_config': g:easycomplete_tabnine_config,
\ 'g:easycomplete_cursor_word_hl': g:easycomplete_cursor_word_hl,
\ 'g:easycomplete_signature_offset': g:easycomplete_signature_offset,
\ 'g:easycomplete_directory_enable': g:easycomplete_directory_enable,
\ }

" VIM 最低版本 8.2
Expand Down

0 comments on commit 9adca42

Please sign in to comment.