summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorKonfekt <Konfekt@users.noreply.github.com>2024-02-26 08:20:16 +0100
committerKonfekt <Konfekt@users.noreply.github.com>2024-02-26 10:10:18 +0100
commitdec808e78845cb981a7d8d23ac1a1c0eac58d114 (patch)
tree0df88197fc454319c46740c98f76d598e2827514 /README.md
parent46e3d5a609fdaa2ddb2af6cc5cb4e754b8b39bfa (diff)
downloadvim-ai-dec808e78845cb981a7d8d23ac1a1c0eac58d114.tar.gz
drop superfluous selection argument and fix instruction argument
Diffstat (limited to '')
-rw-r--r--README.md7
1 files changed, 3 insertions, 4 deletions
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 <line1>,<line2>call CodeReviewFn(<range>)
+command! -range=0 CodeReview <line1>,<line2>call CodeReviewFn(<count>)
```
## Contributing