diff options
Diffstat (limited to 'py/roles.py')
| -rw-r--r-- | py/roles.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/py/roles.py b/py/roles.py index a8689f2..6e0a52e 100644 --- a/py/roles.py +++ b/py/roles.py @@ -9,6 +9,13 @@ if not os.path.exists(roles_config_path): roles = configparser.ConfigParser() roles.read(roles_config_path) +if vim.eval("exists('g:vim_ai_roles_config_function')") == '1': + roles_config_function = vim.eval("g:vim_ai_roles_config_function") + if not vim.eval("exists('*" + roles_config_function + "')"): + raise Exception(f"Role config function does not exist: {roles_config_function}") + else: + roles.update(vim.eval(roles_config_function + "()")) + role_names = [name for name in roles.sections() if not '.' in name] role_list = [f'"{name}"' for name in role_names] |