feat(utils): add type annotations and inline documentation to various utility modules
This commit is contained in:
+13
-3
@@ -1,7 +1,13 @@
|
||||
---@module "utils.git"
|
||||
--- This module provides functions to interact with GitGraph within Neovim.
|
||||
--- It includes functions to draw, close, and toggle the GitGraph tab.
|
||||
|
||||
local M = {}
|
||||
|
||||
--- Opens the GitGraph in a new tab if it's not already open.
|
||||
--- @return nil
|
||||
function M.gitgraph_draw()
|
||||
-- open gitgraph in a seperate tab
|
||||
-- Open gitgraph in a separate tab
|
||||
if vim.bo.filetype == "gitgraph" then
|
||||
return
|
||||
end
|
||||
@@ -9,8 +15,10 @@ function M.gitgraph_draw()
|
||||
require("gitgraph").draw({}, { all = true, max_count = 5000 })
|
||||
end
|
||||
|
||||
--- Closes the tab page if it is a GitGraph page.
|
||||
--- @return nil
|
||||
function M.gitgraph_close()
|
||||
--- close the tab page if it is a gitgraph page
|
||||
-- Close the tab page if it is a gitgraph page
|
||||
if vim.bo.filetype == "gitgraph" then
|
||||
vim.cmd("tabclose")
|
||||
else
|
||||
@@ -18,8 +26,10 @@ function M.gitgraph_close()
|
||||
end
|
||||
end
|
||||
|
||||
--- Toggles the GitGraph tab. Opens it if not already open, and closes it if it is.
|
||||
--- @return nil
|
||||
function M.gitgraph_toggle()
|
||||
-- toggle gitgraph
|
||||
-- Toggle gitgraph
|
||||
if vim.bo.filetype == "gitgraph" then
|
||||
M.gitgraph_close()
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user