|
The application was restricted to loading role configurations only from
a predefined config file, which limited extensibility.
Enable dynamic role configuration by invoking a custom Vim function if
it is defined. This allows users to extend the role configurations
beyond the static file.
diff --git a/doc/vim-ai.txt b/doc/vim-ai.txt:
-The roles in g:vim_ai_roles_config_file are converted to a Vim dictionary.
-Optionally, additional roles can be added by defining a function VimAIRoleParser()
-whose output is a dictionary of the same format as g:vim_ai_roles_config_file.
-
diff --git a/py/roles.py b/py/roles.py:
-if vim.eval('exists("*VimAIRoleParser")'):
- roles.update(vim.eval('VimAIRoleParser()'))
-
diff --git a/py/utils.py b/py/utils.py:
- if vim.eval('exists("*VimAIRoleParser")'):
- roles.update(vim.eval('VimAIRoleParser()'))
-
|