From 59a89739b3d25fc74891b6e086c40b6830702103 Mon Sep 17 00:00:00 2001 From: Martin Bielik Date: Thu, 9 Mar 2023 21:22:12 +0100 Subject: expose debug option --- plugin/vim-ai.vim | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'plugin/vim-ai.vim') 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(':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..." -- cgit v1.2.3