chore: apply stylua

This commit is contained in:
Myzel394 2025-06-06 12:54:16 +02:00
parent 895e9adfdf
commit 0e5158a8d4
Signed by: Myzel394
GPG Key ID: 79E65B4AA44EBBF0
2 changed files with 57 additions and 52 deletions

View File

@ -208,7 +208,9 @@ end
---@param name string
---@return boolean
function M:is_module_available(name)
return pcall(function() require(name) end) == true
return pcall(function()
require(name)
end) == true
end
return M

View File

@ -69,9 +69,9 @@ local DEFAULT_CONFIG = {
---@param prompt_bufnr number
function(path, prompt_bufnr)
vim.fn.setreg("+", path)
end
}
}
end,
},
},
}
local global_config = {}
@ -122,13 +122,16 @@ if global_config.commands.copy_jsonpath and utils:is_module_available("jsonpath"
local current_picker = action_state.get_current_picker(prompt_bufnr)
local selection = current_picker:get_selection()
local path = jsonpath.get(vim.treesitter.get_node({
local path = jsonpath.get(
vim.treesitter.get_node({
bufnr = buffer,
pos = {
selection.lnum - 1,
selection.index,
}
}), buffer)
},
}),
buffer
)
if path then
global_config.commands.copy_jsonpath[3](path, prompt_bufnr)