From dec808e78845cb981a7d8d23ac1a1c0eac58d114 Mon Sep 17 00:00:00 2001 From: Konfekt Date: Mon, 26 Feb 2024 08:20:16 +0100 Subject: drop superfluous selection argument and fix instruction argument --- doc/vim-ai.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/vim-ai.txt b/doc/vim-ai.txt index 34765d7..72535b3 100644 --- a/doc/vim-ai.txt +++ b/doc/vim-ai.txt @@ -188,7 +188,6 @@ To create custom commands, call `AIRun`, `AIEditRun` and `AIChatRun` functions: function! AIPromptCommitMessageFn() let l:diff = system('git diff --staged') let l:prompt = "generate a short commit message from the diff below:\n" . l:diff - let l:range = 0 let l:config = { \ "engine": "chat", \ "options": { @@ -197,12 +196,12 @@ To create custom commands, call `AIRun`, `AIEditRun` and `AIChatRun` functions: \ "temperature": 1, \ }, \} - call vim_ai#AIRun(l:range, l:config, l:prompt) + call vim_ai#AIRun(l:config, l:prompt) endfunction - command! AIPromptCommitMessage call AIPromptCommitMessageFn() + command! AIPromptCommitMessage call AIPromptCommitMessageFn(range) " custom command that provides a code review for selected code block - function! AIPromptCodeReviewFn(range) range + function! AIPromptCodeReviewFn() range let l:prompt = "programming syntax is " . &filetype . ", review the code below" let l:config = { \ "options": { @@ -211,7 +210,7 @@ To create custom commands, call `AIRun`, `AIEditRun` and `AIChatRun` functions: \} '<,'>call vim_ai#AIChatRun(a:range, l:config, l:prompt) endfunction - command! -range AIPromptCodeReview ,call AIPromptCodeReviewFn() + command! -range=0 AIPromptCodeReview ,call AIPromptCodeReviewFn() ABOUT *vim-ai-about* -- cgit v1.2.3