diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2023-03-09 21:22:12 +0100 |
|---|---|---|
| committer | Martin Bielik <mx.bielik@gmail.com> | 2023-03-09 21:22:12 +0100 |
| commit | 59a89739b3d25fc74891b6e086c40b6830702103 (patch) | |
| tree | e21d04fa79ab72453db7b84229be38980814315c | |
| parent | e2027bbae9c9aea7fb4c0750313996ec4a3559b2 (diff) | |
| download | vim-ai-59a89739b3d25fc74891b6e086c40b6830702103.tar.gz | |
expose debug option
Diffstat (limited to '')
| -rw-r--r-- | doc/tags | 1 | ||||
| -rw-r--r-- | plugin/vim-ai.vim | 17 |
2 files changed, 11 insertions, 7 deletions
@@ -1,4 +1,5 @@ :AI vim-ai.txt /*:AI* +:AIEdit vim-ai.txt /*:AIEdit* vim-ai vim-ai.txt /*vim-ai* vim-ai-about vim-ai.txt /*vim-ai-about* vim-ai-commands vim-ai.txt /*vim-ai-commands* diff --git a/plugin/vim-ai.vim b/plugin/vim-ai.vim index 1e9407f..6c473b1 100644 --- a/plugin/vim-ai.vim +++ b/plugin/vim-ai.vim @@ -1,7 +1,10 @@ let s:plugin_root = expand('<sfile>:p:h:h') let s:complete_py = s:plugin_root . "/py/complete.py" let s:chat_py = s:plugin_root . "/py/chat.py" -let s:debug = 0 + +if !exists('g:vim_ai_debug') + let g:vim_ai_debug = 0 +endif function! ScratchWindow() below new @@ -27,8 +30,8 @@ function! AIRun(...) range let prompt = lines endif - if s:debug - echo prompt + if g:vim_ai_debug + echo "Prompt:\n" . prompt . "\n" endif echo "Completing..." @@ -51,8 +54,8 @@ function! AIEditRun(...) range let buff_lastline = line('$') - if s:debug - echo prompt + if g:vim_ai_debug + echo "Prompt:\n" . prompt . "\n" endif echo "Editing..." @@ -99,8 +102,8 @@ function! AIChatRun(...) range endif endif - if s:debug - echo prompt + if g:vim_ai_debug + echo "Prompt:\n" . prompt . "\n" endif echo "Answering..." |