Skip to content

Commit

Permalink
Add context['bufpath']
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Jan 16, 2017
1 parent 41e2e31 commit 5402d02
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion autoload/deoplete/init.vim
Expand Up @@ -192,6 +192,12 @@ function! deoplete#init#_context(event, sources) abort

let width = winwidth(0) - col('.') + len(matchstr(input, '\w*$'))

let bufname = bufname('%')
let bufpath = fnamemodify(bufname, ':p')
if &l:buftype =~ 'nofile' || !filereadable(bufpath)
let bufpath = ''
endif

return {
\ 'changedtick': b:changedtick,
\ 'event': event,
Expand All @@ -213,7 +219,8 @@ function! deoplete#init#_context(event, sources) abort
\ 'max_menu_width': (width * 2 / 3),
\ 'runtimepath': &runtimepath,
\ 'bufnr': bufnr('%'),
\ 'bufname': bufname('%'),
\ 'bufname': bufname,
\ 'bufpath': bufpath,
\ 'cwd': getcwd(),
\ 'start_complete': "\<Plug>_",
\ 'vars': filter(copy(g:), "stridx(v:key, 'deoplete#') == 0"),
Expand Down

0 comments on commit 5402d02

Please sign in to comment.