Skip to content

Commit

Permalink
Load recursive sources/filters
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Feb 5, 2018
1 parent 2bdf7ad commit a17f37b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions doc/denite.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ converter_relative_word
CREATE SOURCE *denite-create-source*

To create source, you should read default sources implementation in
rplugin/python3/denite/source/*.py.
rplugin/python3/denite/source/**/*.py.

The files are automatically loaded and denite creates new Source class object.
Source class must extend Base class in ".base".
Expand Down Expand Up @@ -1946,7 +1946,7 @@ CREATE KIND *denite-create-kind*

Custom Kind can be created to contain extra actions for your custom source.
Before create your new kind, you should have a look at existing kinds in
rplugin/python3/denite/kind/*.py
rplugin/python3/denite/kind/**/*.py

Instead of create new kind from scratch, you can extend one of the existing
Kind class, let's take "openable" for example: >
Expand Down Expand Up @@ -2030,7 +2030,7 @@ action_{name} (Function) (Optional)
CREATE FILTER *denite-create-filter*

To create filter, you should read default filters implementation in
rplugin/python3/denite/filter/*.py.
rplugin/python3/denite/filter/**/*.py.

The files are automatically loaded and denite creates new Filter class object.
Filter class must extend Base class in ".base".
Expand Down
4 changes: 2 additions & 2 deletions rplugin/python3/denite/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ def find_rplugins(context, source, loaded_paths):
Searches $VIMRUNTIME/*/rplugin/python3/denite/$source/
"""

src = join('rplugin/python3/denite', source, '*.py')
src = join('rplugin/python3/denite', source, '**/*.py')
for runtime in context.get('runtimepath', '').split(','):
for path in glob.iglob(os.path.join(runtime, src)):
for path in glob.iglob(os.path.join(runtime, src), recursive=True):
name = os.path.splitext(os.path.basename(path))[0]
if ((source != 'kind' and name == 'base') or
name == '__init__' or path in loaded_paths):
Expand Down

0 comments on commit a17f37b

Please sign in to comment.