Skip to content

Commit 30ebb7d

Browse files
committed
feat(diff): improve diff application and buffer handling
Refactored diff handling in mappings to use unified diff parsing and application. Removed legacy line-numbered diff logic and replaced with buffer-aware unified diff utilities. Updated prompts and resource block generation to match new diff format. Improves reliability and accuracy when applying, showing, and yanking diffs in chat. Signed-off-by: Tomas Slusny <[email protected]>
1 parent 418562e commit 30ebb7d

File tree

10 files changed

+620
-300
lines changed

10 files changed

+620
-300
lines changed

lua/CopilotChat/config.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
---@field tools string|table<string>|nil
2020
---@field resources string|table<string>|nil
2121
---@field sticky string|table<string>|nil
22+
---@field diff 'block'|'unified'?
2223
---@field language string?
2324
---@field temperature number?
2425
---@field headless boolean?
@@ -62,6 +63,7 @@ return {
6263
tools = nil, -- Default tool or array of tools (or groups) to share with LLM (can be specified manually in prompt via @).
6364
resources = 'selection', -- Default resources to share with LLM (can be specified manually in prompt via #).
6465
sticky = nil, -- Default sticky prompt or array of sticky prompts to use at start of every new chat (can be specified manually in prompt via >).
66+
diff = 'block', -- Default diff format to use, 'block' or 'unified'.
6567
language = 'English', -- Default language to use for answers
6668

6769
temperature = 0.1, -- Result temperature

0 commit comments

Comments
 (0)