Skip to content

Commit 1d7a668

Browse files
committed
fix(quick_chat_context): don't re-indent selection
1 parent 54ba441 commit 1d7a668

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

lua/opencode/context/base_context.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,14 @@ end)
231231
---@param file table
232232
---@param content string
233233
---@param lines string
234+
---@param raw_indent? boolean
234235
---@return table
235-
function M.new_selection(file, content, lines)
236+
function M.new_selection(file, content, lines, raw_indent)
236237
return {
237238
file = file,
238-
content = util.indent_code_block(content),
239+
content = raw_indent and content or util.indent_code_block(content),
239240
lines = lines,
240241
}
241242
end
242243

243244
return M
244-

lua/opencode/context/quick_chat_context.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
-- QuickChatContext for quick chat interface
2-
-- Outputs plain text formatted context for simple LLM consumption
3-
41
local base_context = require('opencode.context.base_context')
52
local util = require('opencode.util')
63
local Promise = require('opencode.promise')
@@ -144,7 +141,8 @@ M.format_message = Promise.async(function(prompt, opts)
144141
extension = vim.fn.fnamemodify(file, ':e'),
145142
},
146143
table.concat(vim.api.nvim_buf_get_lines(buf, range.start - 1, range.stop, false), '\n'),
147-
string.format('%d-%d', range.start, range.stop)
144+
string.format('%d-%d', range.start, range.stop),
145+
true
148146
)
149147
table.insert(selections, selection)
150148
end

0 commit comments

Comments
 (0)