Skip to content

Commit 8eee7e6

Browse files
aweis89sudo-tee
authored andcommitted
fix(context): simplify file addition logic
- remove redundant checks for file readability and directory status
1 parent a6da161 commit 8eee7e6

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

lua/opencode/context/chat_context.lua

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,6 @@ end
193193
function M.add_file(file)
194194
local is_file = vim.fn.filereadable(file) == 1
195195
local is_dir = vim.fn.isdirectory(file) == 1
196-
if not is_file and not is_dir then
197-
vim.notify('File not added to context. Could not read.')
198-
return
199-
end
200-
201-
if not util.is_path_in_cwd(file) and not util.is_temp_path(file, 'pasted_image') then
202-
vim.notify('File not added to context. Must be inside current working directory.')
203-
return
204-
end
205-
206196
file = vim.fn.fnamemodify(file, ':p')
207197

208198
if not M.context.mentioned_files then

0 commit comments

Comments
 (0)