summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorMartin Bielik <martin.bielik@instea.sk>2024-07-25 21:55:31 +0200
committerMartin Bielik <martin.bielik@instea.sk>2024-07-25 21:55:31 +0200
commite18d29dac7fdf616a6a738fdb8ab017e0c3f8549 (patch)
tree2309e43703ceaf7bb15a7326ba177b42083e42d8 /autoload
parent4e0e82f75beaa31b06b08153a5243cbfaa1fbd8b (diff)
downloadvim-ai-e18d29dac7fdf616a6a738fdb8ab017e0c3f8549.tar.gz
private MakeScratchWindow function
Diffstat (limited to 'autoload')
-rw-r--r--autoload/vim_ai.vim7
1 files changed, 4 insertions, 3 deletions
diff --git a/autoload/vim_ai.vim b/autoload/vim_ai.vim
index 94a5b3f..a9c3d0a 100644
--- a/autoload/vim_ai.vim
+++ b/autoload/vim_ai.vim
@@ -33,10 +33,11 @@ endfunction
" Configures ai-chat scratch window.
" - scratch_buffer_keep_open = 0
" - opens new ai-chat every time
+" - excludes buffer from buffer list
" - scratch_buffer_keep_open = 1
-" - opens last ai-chat buffer
+" - opens last ai-chat buffer (unless force_new = 1)
" - keeps the buffer in the buffer list
-function! vim_ai#MakeScratchWindow(force_new) abort
+function! s:MakeScratchWindow(force_new) abort
let l:keep_open = g:vim_ai_chat['ui']['scratch_buffer_keep_open']
let l:last_scratch_buffer_name = s:GetLastScratchBufferName()
if l:keep_open && bufexists(l:last_scratch_buffer_name) && !a:force_new
@@ -92,7 +93,7 @@ function! s:OpenChatWindow(open_conf, force_new)
\ ? g:vim_ai_open_chat_presets[a:open_conf]
\ : a:open_conf
execute l:open_cmd
- call vim_ai#MakeScratchWindow(a:force_new)
+ call s:MakeScratchWindow(a:force_new)
endfunction