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 --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 5d7f26c..1bc1f34 100644 --- a/README.md +++ b/README.md @@ -377,7 +377,6 @@ To create a custom command, you can call `AIRun`, `AIEditRun` and `AIChatRun` fu function! GitCommitMessageFn() let l:diff = system('git --no-pager 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": { @@ -386,7 +385,7 @@ function! GitCommitMessageFn() \ "temperature": 1, \ }, \} - call vim_ai#AIRun(l:range, l:config, l:prompt) + call vim_ai#AIRun(l:config, l:prompt) endfunction command! GitCommitMessage call GitCommitMessageFn() @@ -398,9 +397,9 @@ function! CodeReviewFn(range) range \ "initial_prompt": ">>> system\nyou are a clean code expert", \ }, \} - '<,'>call vim_ai#AIChatRun(a:range, l:config, l:prompt) + exe a:firstline.",".a:lastline . "call vim_ai#AIChatRun(a:range, l:config, l:prompt)" endfunction -command! -range CodeReview ,call CodeReviewFn() +command! -range=0 CodeReview ,call CodeReviewFn() ``` ## Contributing -- cgit v1.2.3