From a17f37b18b94162311ec9fd4849656e9b3fd3986 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Tue, 6 Feb 2018 06:43:58 +0900 Subject: [PATCH] Load recursive sources/filters --- doc/denite.txt | 6 +++--- rplugin/python3/denite/util.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/denite.txt b/doc/denite.txt index 45e009951..6581b447e 100644 --- a/doc/denite.txt +++ b/doc/denite.txt @@ -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". @@ -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: > @@ -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". diff --git a/rplugin/python3/denite/util.py b/rplugin/python3/denite/util.py index 725693c72..66dd5ff99 100644 --- a/rplugin/python3/denite/util.py +++ b/rplugin/python3/denite/util.py @@ -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):