Skip to content

Commit

Permalink
resolve #51: accept wildcard in runtimepath in thesaurus_query Python…
Browse files Browse the repository at this point in the history
… package path finding
  • Loading branch information
Ron89 committed Jan 30, 2022
1 parent 65e67a2 commit 23d8aa3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions autoload/thesaurus_query.vim
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,12 @@ endfunction
" Import Python libs {{{

exec s:tq_python_env
import sys, os, vim

import sys, os, vim, glob
for p in vim.eval("&runtimepath").split(','):
dname = os.path.join(p, "autoload")
if os.path.exists(os.path.join(dname, "thesaurus_query")):
globRes = glob.glob(os.path.join(p, "autoload", "thesaurus_query"))
if len(globRes)==1:
dname = os.path.dirname(globRes[0])
if dname not in sys.path:
sys.path.append(dname)
break
Expand Down

0 comments on commit 23d8aa3

Please sign in to comment.