chore(fmt): Consistent function doc style

This commit is contained in:
hedy
2023-11-26 13:27:29 +08:00
parent 9f69f12161
commit 137e76fdca
2 changed files with 10 additions and 8 deletions

View File

@@ -49,8 +49,8 @@ function M._get_sidebar(set_current)
return sidebar return sidebar
end end
---Run a Sidebar method by getting the sidebar of current tabpage, with args ---Run a Sidebar method by getting the sidebar of current tabpage, with args.
-- NOP if sidebar not found for this tabpage. ---NOP if sidebar not found for this tabpage.
---@param method string Must be valid ---@param method string Must be valid
---@param args table? ---@param args table?
---@return any return_of_method Depends on sidebar `method` ---@return any return_of_method Depends on sidebar `method`
@@ -71,7 +71,7 @@ end
M.close = M.close_outline M.close = M.close_outline
---Toggle the outline window, and return whether the outline window is open ---Toggle the outline window, and return whether the outline window is open
-- after this operation. ---after this operation.
---@param opts outline.OutlineOpts? Table of options ---@param opts outline.OutlineOpts? Table of options
---@return boolean is_open Whether outline window is now open ---@return boolean is_open Whether outline window is now open
function M.toggle_outline(opts) function M.toggle_outline(opts)
@@ -86,7 +86,7 @@ end
M.toggle = M.toggle_outline M.toggle = M.toggle_outline
---Set cursor to focus on the outline window, return whether the window is ---Set cursor to focus on the outline window, return whether the window is
-- currently open. ---currently open.
---@return boolean is_open Whether the window is open ---@return boolean is_open Whether the window is open
function M.focus_outline() function M.focus_outline()
return M._sidebar_do('focus') return M._sidebar_do('focus')

View File

@@ -247,6 +247,7 @@ function Sidebar:reset_cursor_style()
vim.o.guicursor = self.original_cursor vim.o.guicursor = self.original_cursor
end end
---Set the cursor to current.line_in_outline and column to a convenient place
---@param current outline.FlatSymbolNode? ---@param current outline.FlatSymbolNode?
function Sidebar:update_cursor_pos(current) function Sidebar:update_cursor_pos(current)
local col = 0 local col = 0
@@ -261,7 +262,7 @@ function Sidebar:update_cursor_pos(current)
end end
---Calls build_outline and then calls update_cursor_pos if update_cursor is ---Calls build_outline and then calls update_cursor_pos if update_cursor is
--not false ---not false
---@param update_cursor boolean? ---@param update_cursor boolean?
---@param set_cursor_to_node outline.SymbolNode|outline.FlatSymbolNode? ---@param set_cursor_to_node outline.SymbolNode|outline.FlatSymbolNode?
function Sidebar:_update_lines(update_cursor, set_cursor_to_node) function Sidebar:_update_lines(update_cursor, set_cursor_to_node)
@@ -315,12 +316,13 @@ function Sidebar:__refresh()
end end
end end
-- stylua: ignore start
function Sidebar:_refresh() function Sidebar:_refresh()
(utils.debounce(function() (utils.debounce(function() self:__refresh() end, 100))()
self:__refresh()
end, 100))()
end end
-- stylua: ignore end
---Currently hovered node in outline
---@return outline.FlatSymbolNode ---@return outline.FlatSymbolNode
function Sidebar:_current_node() function Sidebar:_current_node()
local current_line = vim.api.nvim_win_get_cursor(self.view.winnr)[1] local current_line = vim.api.nvim_win_get_cursor(self.view.winnr)[1]