diff options
Diffstat (limited to 'autoload')
| -rw-r--r-- | autoload/vim_ai.vim | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/autoload/vim_ai.vim b/autoload/vim_ai.vim index ac79f3b..00792dd 100644 --- a/autoload/vim_ai.vim +++ b/autoload/vim_ai.vim @@ -52,9 +52,13 @@ function! s:MakePrompt(is_selection, lines, instruction) if l:instruction == "" let l:selection = l:lines elseif a:is_selection - " TODO: check if lines already contain ##### " NOTE: surround selection with ##### in order to eliminate empty responses - let l:selection = "#####\n" . l:lines . "\n#####" + " TODO: add selection prompt boundary config + if match(l:lines, "#####") != -1 + let l:selection = l:lines + else + let l:selection = "#####\n" . l:lines . "\n#####" + endif endif return join([l:instruction, l:delimiter, l:selection], "") endfunction |