Skip to content

Commit

Permalink
feat: util method to open a float
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 24, 2022
1 parent b34e258 commit 7c2eb15
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/lazy/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ function M.file_exists(file)
return vim.loop.fs_stat(file) ~= nil
end

---@param opts? LazyViewOptions
function M.float(opts)
opts = vim.tbl_deep_extend("force", {
win_opts = { zindex = 60, border = "none" },
margin = { top = 3, left = 2, right = 2 },
}, opts or {})
return require("lazy.view.float")(opts)
end

function M.open(uri)
if M.file_exists(uri) then
vim.cmd.split()
Expand Down

0 comments on commit 7c2eb15

Please sign in to comment.