fix: refine tools (#1706)
* fix: refine tools * fix: missing break line * fix: view a in-context file * fix: remove create_file tests
This commit is contained in:
@@ -61,4 +61,15 @@ function M.has_permission_to_access(abs_path)
|
||||
return not M.is_ignored(abs_path)
|
||||
end
|
||||
|
||||
---@param path string
|
||||
---@return boolean
|
||||
function M.already_in_context(path)
|
||||
local sidebar = require("avante").get()
|
||||
if sidebar and sidebar.file_selector then
|
||||
local rel_path = Utils.uniform_path(path)
|
||||
return vim.tbl_contains(sidebar.file_selector.selected_filepaths, rel_path)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user