Skip to content

Commit afafec5

Browse files
authored
feat(prompts): support buffer replacement in commit messages (#1370)
Extend Commit prompt to handle buffer replacement when COMMIT_EDITMSG is opened. This allows generating commit messages that can fully replace the buffer, improving workflow for staged changes. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
1 parent d7d65d6 commit afafec5

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lua/CopilotChat/config/prompts.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,10 @@ If no issues found, confirm the code is well-written and explain why.
194194
},
195195

196196
Commit = {
197-
prompt = 'Write commit message for the change with commitizen convention. Keep the title under 50 characters and wrap message at 72 characters. Format as a gitcommit code block.',
198-
resources = 'gitdiff:staged',
197+
prompt = 'Write commit message for the change with commitizen convention. Keep the title under 50 characters and wrap message at 72 characters. Format as a gitcommit code block. If user has COMMIT_EDITMSG opened, generate replacement block for whole buffer.',
198+
resources = {
199+
'gitdiff:staged',
200+
'buffer',
201+
},
199202
},
200203
}

0 commit comments

Comments
 (0)