aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/ui/display.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-08-15 21:03:06 +0200
committerGitHub <noreply@github.com>2022-08-15 21:03:06 +0200
commit3c62386a396ae0c1cd7adbaacc379eb4af072a65 (patch)
tree4d00d20958839a04e6a996c11b97724c762e491a /lua/mason-core/ui/display.lua
parentchore: update generated code (#295) (diff)
downloadmason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.gz
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.bz2
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.lz
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.xz
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.zst
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.zip
refactor: introduce selene, harden type defs, and use proper EmmyLua syntax (#296)
Diffstat (limited to 'lua/mason-core/ui/display.lua')
-rw-r--r--lua/mason-core/ui/display.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/lua/mason-core/ui/display.lua b/lua/mason-core/ui/display.lua
index 795cac52..97fc36fc 100644
--- a/lua/mason-core/ui/display.lua
+++ b/lua/mason-core/ui/display.lua
@@ -48,8 +48,8 @@ end
---@param viewport_context ViewportContext
---@param node INode
----@param _render_context RenderContext|nil
----@param _output RenderOutput|nil
+---@param _render_context RenderContext?
+---@param _output RenderOutput?
local function render_node(viewport_context, node, _render_context, _output)
---@class RenderContext
---@field viewport_context ViewportContext
@@ -77,7 +77,7 @@ local function render_node(viewport_context, node, _render_context, _output)
---@class RenderOutput
---@field lines string[]: The buffer lines.
- ---@field virt_texts string[][]: List of (text, highlight) tuples.
+ ---@field virt_texts {line: integer, content: table}[]: List of tuples.
---@field highlights RenderHighlight[]
---@field keybinds RenderKeybind[]
---@field diagnostics RenderDiagnostic[]
@@ -168,7 +168,7 @@ M._render_node = render_node
---@alias WindowOpts {effects: table<string, fun()>, highlight_groups: table<string, table>, border: string|table}
---@param opts WindowOpenOpts
----@param sizes_only boolean: Whether to only return properties that control the window size.
+---@param sizes_only boolean Whether to only return properties that control the window size.
local function create_popup_window_opts(opts, sizes_only)
local win_height = vim.o.lines - vim.o.cmdheight - 2 -- Add margin for status and buffer line
local win_width = vim.o.columns
@@ -191,7 +191,7 @@ local function create_popup_window_opts(opts, sizes_only)
return popup_layout
end
----@param name string: Human readable identifier.
+---@param name string Human readable identifier.
---@param filetype string
function M.new_view_only_win(name, filetype)
local namespace = vim.api.nvim_create_namespace(("installer_%s"):format(name))
@@ -402,7 +402,7 @@ function M.new_view_only_win(name, filetype)
group = autoclose_augroup,
buffer = bufnr,
callback = function()
- -- Schedule is done because otherwise the window wont actually close in some cases (for example if
+ -- Schedule is done because otherwise the window won't actually close in some cases (for example if
-- you're loading another buffer into it)
vim.schedule(function()
if vim.api.nvim_win_is_valid(win_id) then