Skip to content

Commit

Permalink
Fix neovim nightly rtp not returning all paths
Browse files Browse the repository at this point in the history
Resolves: #98
  • Loading branch information
kristijanhusak committed Sep 20, 2021
1 parent 3900e10 commit 8fcde4c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions autoload/db/adapter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function! s:prefix(url) abort
let file = 'autoload/'.substitute(tr(prefix, '#', '/'), '/[^/]*$', '.vim', '')
if has_key(s:loaded, adapter) || prefix !~# '#'
return prefix
elseif !empty(findfile(file, escape(&rtp, ' ')))
elseif !empty(findfile(file, escape(&rtp, ' '))) || (exists('*nvim_get_runtime_file') && !empty(nvim_get_runtime_file(file, v:false)))
execute 'runtime!' file
let s:loaded[adapter] = 1
return prefix
Expand Down Expand Up @@ -58,8 +58,12 @@ function! db#adapter#dispatch(url, fn, ...) abort
endfunction

function! db#adapter#schemes() abort
let rtp = &rtp
if exists('*nvim_list_runtime_paths')
let rtp = join(nvim_list_runtime_paths(), ',')
endif
return map(
\ split(globpath(escape(&rtp, ' '), 'autoload/db/adapter/*.vim'), "\n"),
\ split(globpath(escape(rtp, ' '), 'autoload/db/adapter/*.vim'), "\n"),
\ 'tr(fnamemodify(v:val, ":t:r"), "_", "-")') +
\ filter(map(keys(g:), 'matchstr(v:val, "^db_adapter_\\zs.*")'), 'len(v:val)')
endfunction

0 comments on commit 8fcde4c

Please sign in to comment.