-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathgap.lua
More file actions
32 lines (28 loc) · 740 Bytes
/
gap.lua
File metadata and controls
32 lines (28 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
local Component = require("nui-components.component")
local Layout = require("nui.layout")
local fn = require("nui-components.utils.fn")
---@class NuiComponents.Gap: NuiComponents.Component
---@overload fun(_, props: table<string, any>, popup_options: NuiPopupOptions): NuiComponents.Gap
---@field super NuiComponents.Component
local Gap = Component:extend("Gap")
function Gap:init(props, popup_options)
Gap.super.init(
self,
fn.merge(
{
size = 1,
},
fn.merge(props, {
is_focusable = false,
})
),
fn.deep_merge({
focusable = false,
zindex = 99,
}, popup_options)
)
end
function Gap:render()
return Layout.Box(self, { size = self:get_size() })
end
return Gap