diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2024-02-26 22:22:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-26 22:22:49 +0100 |
| commit | d482318e7a0666d078f21df4a54440de5ceed3fa (patch) | |
| tree | 0fdd533d2050737aa42043b6981bbbd50896cf01 /doc/vim-ai.txt | |
| parent | ed6333e968d563c12b24cbd78605578914a7f32a (diff) | |
| parent | cbc890a85c98f792b3d2743724cd533705f868b3 (diff) | |
| download | vim-ai-d482318e7a0666d078f21df4a54440de5ceed3fa.tar.gz | |
Merge pull request #77 from Konfekt/range
fix selection handling in vim_ai functions
Diffstat (limited to 'doc/vim-ai.txt')
| -rw-r--r-- | doc/vim-ai.txt | 9 |
1 files changed, 4 insertions, 5 deletions
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 <line1>,<line2>call AIPromptCodeReviewFn(<range>) + command! -range=0 AIPromptCodeReview <line1>,<line2>call AIPromptCodeReviewFn(<count>) ABOUT *vim-ai-about* |