Skip to content

Commit

Permalink
Merge pull request #144 from jiangyinzuo/patch-1
Browse files Browse the repository at this point in the history
docs: fix costom commands vim_ai#AIRun()
  • Loading branch information
madox2 authored Feb 10, 2025
2 parents 380d5cd + f6a2390 commit 91a0373
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/vim-ai.txt
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ To create custom commands, call `AIRun`, `AIEditRun` and `AIChatRun` functions:

" custom command suggesting git commit message, takes no arguments
function! AIPromptCommitMessageFn()
let l:range = 0
let l:diff = system('git diff --staged')
let l:prompt = "generate a short commit message from the diff below:\n" . l:diff
let l:config = {
Expand All @@ -278,7 +279,7 @@ To create custom commands, call `AIRun`, `AIEditRun` and `AIChatRun` functions:
\ "temperature": 1,
\ },
\}
call vim_ai#AIRun(l:config, l:prompt)
call vim_ai#AIRun(l:range, l:config, l:prompt)
endfunction
command! AIPromptCommitMessage call AIPromptCommitMessageFn(range)

Expand Down

0 comments on commit 91a0373

Please sign in to comment.