hyprland: dispatch bind callbacks explicitly
This commit is contained in:
@@ -116,6 +116,10 @@ local function exec(command)
|
|||||||
return hl.dsp.exec_cmd(command)
|
return hl.dsp.exec_cmd(command)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function dispatch(dispatcher)
|
||||||
|
return hl.dispatch(dispatcher)
|
||||||
|
end
|
||||||
|
|
||||||
local function shell_quote(value)
|
local function shell_quote(value)
|
||||||
return "'" .. tostring(value):gsub("'", "'\\''") .. "'"
|
return "'" .. tostring(value):gsub("'", "'\\''") .. "'"
|
||||||
end
|
end
|
||||||
@@ -652,7 +656,7 @@ local function update_nstack_count()
|
|||||||
end
|
end
|
||||||
|
|
||||||
stack_count = math.max(stack_count, 2)
|
stack_count = math.max(stack_count, 2)
|
||||||
hl.dsp.layout("setstackcount " .. tostring(stack_count))()
|
dispatch(hl.dsp.layout("setstackcount " .. tostring(stack_count)))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function schedule_nstack_count_update()
|
local function schedule_nstack_count_update()
|
||||||
@@ -788,24 +792,24 @@ end
|
|||||||
local function monocle_next()
|
local function monocle_next()
|
||||||
local window = hl.get_active_window()
|
local window = hl.get_active_window()
|
||||||
if window and window.group and window.group.size and window.group.size > 1 then
|
if window and window.group and window.group.size and window.group.size > 1 then
|
||||||
hl.dsp.group.next({ window = window_selector(window) })()
|
dispatch(hl.dsp.group.next({ window = window_selector(window) }))
|
||||||
elseif current_layout == monocle_layout then
|
elseif current_layout == monocle_layout then
|
||||||
hl.dsp.layout("cyclenext")()
|
dispatch(hl.dsp.layout("cyclenext"))
|
||||||
update_monocle_notice()
|
update_monocle_notice()
|
||||||
else
|
else
|
||||||
hl.dsp.window.cycle_next({ next = true, tiled = true, floating = false })()
|
dispatch(hl.dsp.window.cycle_next({ next = true, tiled = true, floating = false }))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function monocle_prev()
|
local function monocle_prev()
|
||||||
local window = hl.get_active_window()
|
local window = hl.get_active_window()
|
||||||
if window and window.group and window.group.size and window.group.size > 1 then
|
if window and window.group and window.group.size and window.group.size > 1 then
|
||||||
hl.dsp.group.prev({ window = window_selector(window) })()
|
dispatch(hl.dsp.group.prev({ window = window_selector(window) }))
|
||||||
elseif current_layout == monocle_layout then
|
elseif current_layout == monocle_layout then
|
||||||
hl.dsp.layout("cycleprev")()
|
dispatch(hl.dsp.layout("cycleprev"))
|
||||||
update_monocle_notice()
|
update_monocle_notice()
|
||||||
else
|
else
|
||||||
hl.dsp.window.cycle_next({ next = false, tiled = true, floating = false })()
|
dispatch(hl.dsp.window.cycle_next({ next = false, tiled = true, floating = false }))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -820,30 +824,30 @@ local function focus_direction(direction)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
hl.dsp.focus({ direction = direction })()
|
dispatch(hl.dsp.focus({ direction = direction }))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function swap_direction(direction)
|
local function swap_direction(direction)
|
||||||
if enable_nstack and is_nstack_layout(current_layout) and active_group_size() <= 1 then
|
if enable_nstack and is_nstack_layout(current_layout) and active_group_size() <= 1 then
|
||||||
hl.dsp.layout("swapdirection " .. direction)()
|
dispatch(hl.dsp.layout("swapdirection " .. direction))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
hl.dsp.window.swap({ direction = direction })()
|
dispatch(hl.dsp.window.swap({ direction = direction }))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function focus_workspace(workspace_id)
|
local function focus_workspace(workspace_id)
|
||||||
hl.dsp.focus({ workspace = tostring(workspace_id), on_current_monitor = true })()
|
dispatch(hl.dsp.focus({ workspace = tostring(workspace_id), on_current_monitor = true }))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function move_window_to_workspace(workspace_id, follow, window)
|
local function move_window_to_workspace(workspace_id, follow, window)
|
||||||
local target_window = window or hl.get_active_window()
|
local target_window = window or hl.get_active_window()
|
||||||
local target_selector = window_selector(target_window)
|
local target_selector = window_selector(target_window)
|
||||||
hl.dsp.window.move({ workspace = tostring(workspace_id), follow = false, window = target_selector })()
|
dispatch(hl.dsp.window.move({ workspace = tostring(workspace_id), follow = false, window = target_selector }))
|
||||||
if follow then
|
if follow then
|
||||||
focus_workspace(workspace_id)
|
focus_workspace(workspace_id)
|
||||||
if target_selector then
|
if target_selector then
|
||||||
hl.dsp.focus({ window = target_selector })()
|
dispatch(hl.dsp.focus({ window = target_selector }))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -871,8 +875,8 @@ local function move_window_into_group(window, anchor)
|
|||||||
end
|
end
|
||||||
|
|
||||||
for _, direction in ipairs(grouping_directions(window, anchor)) do
|
for _, direction in ipairs(grouping_directions(window, anchor)) do
|
||||||
hl.dsp.focus({ window = selector })()
|
dispatch(hl.dsp.focus({ window = selector }))
|
||||||
hl.dsp.window.move({ into_group = direction, window = selector })()
|
dispatch(hl.dsp.window.move({ into_group = direction, window = selector }))
|
||||||
|
|
||||||
local active = hl.get_active_window()
|
local active = hl.get_active_window()
|
||||||
if active and active.group and active.group.size and active.group.size > 1 then
|
if active and active.group and active.group.size and active.group.size > 1 then
|
||||||
@@ -960,12 +964,12 @@ local function restore_workspace_tabbed_group()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
hl.dsp.focus({ window = anchor_selector })()
|
dispatch(hl.dsp.focus({ window = anchor_selector }))
|
||||||
hl.dsp.group.toggle({ window = anchor_selector })()
|
dispatch(hl.dsp.group.toggle({ window = anchor_selector }))
|
||||||
tabbed_workspace_groups[key] = nil
|
tabbed_workspace_groups[key] = nil
|
||||||
set_layout(columns_layout)
|
set_layout(columns_layout)
|
||||||
restore_tabbed_group_window_order(state, target_workspace_id)
|
restore_tabbed_group_window_order(state, target_workspace_id)
|
||||||
hl.dsp.focus({ window = anchor_selector })()
|
dispatch(hl.dsp.focus({ window = anchor_selector }))
|
||||||
schedule_nstack_count_update()
|
schedule_nstack_count_update()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1014,8 +1018,8 @@ local function gather_workspace_into_tabbed_group()
|
|||||||
|
|
||||||
set_layout(columns_layout)
|
set_layout(columns_layout)
|
||||||
|
|
||||||
hl.dsp.focus({ window = anchor_selector })()
|
dispatch(hl.dsp.focus({ window = anchor_selector }))
|
||||||
hl.dsp.group.toggle({ window = anchor_selector })()
|
dispatch(hl.dsp.group.toggle({ window = anchor_selector }))
|
||||||
|
|
||||||
local group_windows = {}
|
local group_windows = {}
|
||||||
for _, window in ipairs(candidates) do
|
for _, window in ipairs(candidates) do
|
||||||
@@ -1037,8 +1041,8 @@ local function gather_workspace_into_tabbed_group()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if grouped_count <= 1 then
|
if grouped_count <= 1 then
|
||||||
hl.dsp.focus({ window = anchor_selector })()
|
dispatch(hl.dsp.focus({ window = anchor_selector }))
|
||||||
hl.dsp.group.toggle({ window = anchor_selector })()
|
dispatch(hl.dsp.group.toggle({ window = anchor_selector }))
|
||||||
notify_tabbed_group("Unable to group tiled windows")
|
notify_tabbed_group("Unable to group tiled windows")
|
||||||
return
|
return
|
||||||
elseif grouped_count < #candidates then
|
elseif grouped_count < #candidates then
|
||||||
@@ -1050,7 +1054,7 @@ local function gather_workspace_into_tabbed_group()
|
|||||||
order = original_order,
|
order = original_order,
|
||||||
windows = candidate_addresses,
|
windows = candidate_addresses,
|
||||||
}
|
}
|
||||||
hl.dsp.focus({ window = anchor_selector })()
|
dispatch(hl.dsp.focus({ window = anchor_selector }))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function force_columns_layout()
|
local function force_columns_layout()
|
||||||
@@ -1114,7 +1118,7 @@ local function enter_workspace_swap_mode()
|
|||||||
color = "rgba(edb443ff)",
|
color = "rgba(edb443ff)",
|
||||||
font_size = 13,
|
font_size = 13,
|
||||||
})
|
})
|
||||||
hl.dsp.submap("swap-workspace")()
|
dispatch(hl.dsp.submap("swap-workspace"))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function focus_next_empty_workspace()
|
local function focus_next_empty_workspace()
|
||||||
@@ -1149,10 +1153,10 @@ local function move_window_to_monitor(direction, follow)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local original_monitor = hl.get_active_monitor()
|
local original_monitor = hl.get_active_monitor()
|
||||||
hl.dsp.window.move({ monitor = direction, follow = follow, window = window_selector(window) })()
|
dispatch(hl.dsp.window.move({ monitor = direction, follow = follow, window = window_selector(window) }))
|
||||||
|
|
||||||
if not follow and original_monitor then
|
if not follow and original_monitor then
|
||||||
hl.dsp.focus({ monitor = original_monitor })()
|
dispatch(hl.dsp.focus({ monitor = original_monitor }))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1170,9 +1174,9 @@ local function move_window_to_empty_workspace_on_monitor(direction)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
hl.dsp.focus({ monitor = target_monitor })()
|
dispatch(hl.dsp.focus({ monitor = target_monitor }))
|
||||||
focus_workspace(workspace_id)
|
focus_workspace(workspace_id)
|
||||||
hl.dsp.focus({ monitor = original_monitor })()
|
dispatch(hl.dsp.focus({ monitor = original_monitor }))
|
||||||
move_window_to_workspace(workspace_id, false, window)
|
move_window_to_workspace(workspace_id, false, window)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1443,35 +1447,35 @@ local function apply_scratchpad_geometry(name, window, target_monitor)
|
|||||||
end
|
end
|
||||||
local selector = window_selector(window)
|
local selector = window_selector(window)
|
||||||
|
|
||||||
hl.dsp.window.float({ action = "enable", window = selector })()
|
dispatch(hl.dsp.window.float({ action = "enable", window = selector }))
|
||||||
hl.dsp.window.tag({ tag = "+scratchpad", window = selector })()
|
dispatch(hl.dsp.window.tag({ tag = "+scratchpad", window = selector }))
|
||||||
hl.dsp.window.tag({ tag = "+scratchpad-" .. name, window = selector })()
|
dispatch(hl.dsp.window.tag({ tag = "+scratchpad-" .. name, window = selector }))
|
||||||
hl.dsp.window.resize({ x = width, y = height, relative = false, window = selector })()
|
dispatch(hl.dsp.window.resize({ x = width, y = height, relative = false, window = selector }))
|
||||||
hl.dsp.window.move({ x = x, y = y, relative = false, window = selector })()
|
dispatch(hl.dsp.window.move({ x = x, y = y, relative = false, window = selector }))
|
||||||
if def.dropdown then
|
if def.dropdown then
|
||||||
hl.dsp.window.set_prop({ prop = "border_size", value = "0", window = selector })()
|
dispatch(hl.dsp.window.set_prop({ prop = "border_size", value = "0", window = selector }))
|
||||||
hl.dsp.window.set_prop({ prop = "no_shadow", value = "1", window = selector })()
|
dispatch(hl.dsp.window.set_prop({ prop = "no_shadow", value = "1", window = selector }))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function float_active_window_preserving_tiled_geometry()
|
local function float_active_window_preserving_tiled_geometry()
|
||||||
local geometry = tiled_window_geometry(hl.get_active_window())
|
local geometry = tiled_window_geometry(hl.get_active_window())
|
||||||
hl.dsp.window.float({ action = "enable", window = geometry and geometry.selector or nil })()
|
dispatch(hl.dsp.window.float({ action = "enable", window = geometry and geometry.selector or nil }))
|
||||||
if geometry then
|
if geometry then
|
||||||
hl.dsp.window.resize({ x = geometry.width, y = geometry.height, relative = false, window = geometry.selector })()
|
dispatch(hl.dsp.window.resize({ x = geometry.width, y = geometry.height, relative = false, window = geometry.selector }))
|
||||||
hl.dsp.window.move({ x = geometry.x, y = geometry.y, relative = false, window = geometry.selector })()
|
dispatch(hl.dsp.window.move({ x = geometry.x, y = geometry.y, relative = false, window = geometry.selector }))
|
||||||
end
|
end
|
||||||
return geometry
|
return geometry
|
||||||
end
|
end
|
||||||
|
|
||||||
local function float_and_drag_active_window()
|
local function float_and_drag_active_window()
|
||||||
float_active_window_preserving_tiled_geometry()
|
float_active_window_preserving_tiled_geometry()
|
||||||
hl.dsp.window.drag()()
|
dispatch(hl.dsp.window.drag())
|
||||||
end
|
end
|
||||||
|
|
||||||
local function float_and_resize_active_window()
|
local function float_and_resize_active_window()
|
||||||
float_active_window_preserving_tiled_geometry()
|
float_active_window_preserving_tiled_geometry()
|
||||||
hl.dsp.window.resize()()
|
dispatch(hl.dsp.window.resize())
|
||||||
end
|
end
|
||||||
|
|
||||||
local function schedule_scratchpad_geometry(name, window, target_monitor)
|
local function schedule_scratchpad_geometry(name, window, target_monitor)
|
||||||
@@ -1493,7 +1497,7 @@ local function show_scratchpad_window(name, window, workspace, target_monitor)
|
|||||||
|
|
||||||
remove_minimized_window(window)
|
remove_minimized_window(window)
|
||||||
move_window_to_workspace(workspace.id, false, window)
|
move_window_to_workspace(workspace.id, false, window)
|
||||||
hl.dsp.focus({ window = window_selector(window) })()
|
dispatch(hl.dsp.focus({ window = window_selector(window) }))
|
||||||
schedule_scratchpad_geometry(name, window, target_monitor or hl.get_active_monitor())
|
schedule_scratchpad_geometry(name, window, target_monitor or hl.get_active_monitor())
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1610,36 +1614,36 @@ local function activate_window_picker_candidate(index)
|
|||||||
local mode = window_picker_mode
|
local mode = window_picker_mode
|
||||||
window_picker_mode = nil
|
window_picker_mode = nil
|
||||||
window_picker_candidates = {}
|
window_picker_candidates = {}
|
||||||
hl.dsp.submap("reset")()
|
dispatch(hl.dsp.submap("reset"))
|
||||||
|
|
||||||
if not window then
|
if not window then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if mode == "go" then
|
if mode == "go" then
|
||||||
hl.dsp.focus({ window = window_selector(window) })()
|
dispatch(hl.dsp.focus({ window = window_selector(window) }))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local workspace = active_workspace()
|
local workspace = active_workspace()
|
||||||
if mode == "bring" and workspace then
|
if mode == "bring" and workspace then
|
||||||
move_window_to_workspace(workspace.id, false, window)
|
move_window_to_workspace(workspace.id, false, window)
|
||||||
hl.dsp.focus({ window = window_selector(window) })()
|
dispatch(hl.dsp.focus({ window = window_selector(window) }))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if mode == "minimized" and workspace then
|
if mode == "minimized" and workspace then
|
||||||
remove_minimized_window(window)
|
remove_minimized_window(window)
|
||||||
restore_minimized_window(window, workspace)
|
restore_minimized_window(window, workspace)
|
||||||
hl.dsp.focus({ window = window_selector(window) })()
|
dispatch(hl.dsp.focus({ window = window_selector(window) }))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if mode == "replace" then
|
if mode == "replace" then
|
||||||
local focused = hl.get_active_window()
|
local focused = hl.get_active_window()
|
||||||
if focused and focused ~= window then
|
if focused and focused ~= window then
|
||||||
hl.dsp.window.swap({ target = window_selector(window), window = window_selector(focused) })()
|
dispatch(hl.dsp.window.swap({ target = window_selector(window), window = window_selector(focused) }))
|
||||||
hl.dsp.focus({ window = window_selector(window) })()
|
dispatch(hl.dsp.focus({ window = window_selector(window) }))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1677,7 +1681,7 @@ local function enter_window_picker(mode)
|
|||||||
color = "rgba(edb443ff)",
|
color = "rgba(edb443ff)",
|
||||||
font_size = 11,
|
font_size = 11,
|
||||||
})
|
})
|
||||||
hl.dsp.submap("window-picker")()
|
dispatch(hl.dsp.submap("window-picker"))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function gather_focused_class()
|
local function gather_focused_class()
|
||||||
@@ -1707,7 +1711,7 @@ end
|
|||||||
local function focus_next_class()
|
local function focus_next_class()
|
||||||
local focused = hl.get_active_window()
|
local focused = hl.get_active_window()
|
||||||
if not focused or not focused.class or focused.class == "" then
|
if not focused or not focused.class or focused.class == "" then
|
||||||
hl.dsp.window.cycle_next({ next = true, tiled = true, floating = false })()
|
dispatch(hl.dsp.window.cycle_next({ next = true, tiled = true, floating = false }))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1736,7 +1740,7 @@ local function focus_next_class()
|
|||||||
local next_class = classes[(current_index % #classes) + 1]
|
local next_class = classes[(current_index % #classes) + 1]
|
||||||
local target = first_by_class[next_class]
|
local target = first_by_class[next_class]
|
||||||
if target then
|
if target then
|
||||||
hl.dsp.focus({ window = window_selector(target) })()
|
dispatch(hl.dsp.focus({ window = window_selector(target) }))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1775,7 +1779,7 @@ local function raise_or_spawn(class_fragment, command)
|
|||||||
local fragment = string.lower(class_fragment)
|
local fragment = string.lower(class_fragment)
|
||||||
for _, window in ipairs(hl.get_windows()) do
|
for _, window in ipairs(hl.get_windows()) do
|
||||||
if is_normal_window(window) and window.class and string.find(string.lower(window.class), fragment, 1, true) then
|
if is_normal_window(window) and window.class and string.find(string.lower(window.class), fragment, 1, true) then
|
||||||
hl.dsp.focus({ window = window_selector(window) })()
|
dispatch(hl.dsp.focus({ window = window_selector(window) }))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1805,7 +1809,7 @@ local function restore_last_minimized()
|
|||||||
local window = table.remove(minimized_windows)
|
local window = table.remove(minimized_windows)
|
||||||
if window and window.address and is_minimized_window(window) then
|
if window and window.address and is_minimized_window(window) then
|
||||||
restore_minimized_window(window, workspace)
|
restore_minimized_window(window, workspace)
|
||||||
hl.dsp.focus({ window = window_selector(window) })()
|
dispatch(hl.dsp.focus({ window = window_selector(window) }))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2180,7 +2184,7 @@ hl.define_submap("swap-workspace", function()
|
|||||||
local workspace_id = i
|
local workspace_id = i
|
||||||
bind(tostring(i), function()
|
bind(tostring(i), function()
|
||||||
swap_current_workspace_with(workspace_id)
|
swap_current_workspace_with(workspace_id)
|
||||||
hl.dsp.submap("reset")()
|
dispatch(hl.dsp.submap("reset"))
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2282,8 +2286,8 @@ for i = 1, 9 do
|
|||||||
bind(main_mod .. " + " .. workspace, hl.dsp.focus({ workspace = workspace, on_current_monitor = true }))
|
bind(main_mod .. " + " .. workspace, hl.dsp.focus({ workspace = workspace, on_current_monitor = true }))
|
||||||
bind(main_mod .. " + SHIFT + " .. workspace, hl.dsp.window.move({ workspace = workspace, follow = false }))
|
bind(main_mod .. " + SHIFT + " .. workspace, hl.dsp.window.move({ workspace = workspace, follow = false }))
|
||||||
bind(main_mod .. " + CTRL + " .. workspace, function()
|
bind(main_mod .. " + CTRL + " .. workspace, function()
|
||||||
hl.dsp.window.move({ workspace = workspace, follow = false })()
|
dispatch(hl.dsp.window.move({ workspace = workspace, follow = false }))
|
||||||
hl.dsp.focus({ workspace = workspace, on_current_monitor = true })()
|
dispatch(hl.dsp.focus({ workspace = workspace, on_current_monitor = true }))
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ pkgs.runCommand "hyprland-config-syntax" {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if grep -nE 'hl[.]dsp.*[)][(][)]' hyprland.lua; then
|
||||||
|
echo "hyprland.lua should use hl.dispatch(...) instead of calling dispatcher objects directly" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
lua ${./smoke-test.lua} ./hyprland.lua
|
lua ${./smoke-test.lua} ./hyprland.lua
|
||||||
touch "$out"
|
touch "$out"
|
||||||
''
|
''
|
||||||
|
|||||||
@@ -3,14 +3,18 @@ local callbacks = {}
|
|||||||
|
|
||||||
local function noop() end
|
local function noop() end
|
||||||
|
|
||||||
local function dispatcher_proxy()
|
local dispatcher = setmetatable({}, {
|
||||||
local proxy = {}
|
|
||||||
return setmetatable(proxy, {
|
|
||||||
__index = function()
|
|
||||||
return dispatcher_proxy()
|
|
||||||
end,
|
|
||||||
__call = function()
|
__call = function()
|
||||||
return noop
|
error("dispatcher objects cannot be called directly; use hl.dispatch(dispatcher)", 2)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
local function dispatcher_namespace()
|
||||||
|
return setmetatable({}, {
|
||||||
|
__index = function()
|
||||||
|
return function()
|
||||||
|
return dispatcher
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@@ -48,6 +52,7 @@ hl = {
|
|||||||
bind = noop,
|
bind = noop,
|
||||||
config = noop,
|
config = noop,
|
||||||
curve = noop,
|
curve = noop,
|
||||||
|
dispatch = noop,
|
||||||
env = noop,
|
env = noop,
|
||||||
exec_cmd = noop,
|
exec_cmd = noop,
|
||||||
define_submap = function(_, reset_or_callback, callback)
|
define_submap = function(_, reset_or_callback, callback)
|
||||||
@@ -59,7 +64,17 @@ hl = {
|
|||||||
monitor = noop,
|
monitor = noop,
|
||||||
workspace_rule = noop,
|
workspace_rule = noop,
|
||||||
window_rule = noop,
|
window_rule = noop,
|
||||||
dsp = dispatcher_proxy(),
|
dsp = setmetatable({
|
||||||
|
group = dispatcher_namespace(),
|
||||||
|
window = dispatcher_namespace(),
|
||||||
|
workspace = dispatcher_namespace(),
|
||||||
|
}, {
|
||||||
|
__index = function()
|
||||||
|
return function()
|
||||||
|
return dispatcher
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}),
|
||||||
notification = {
|
notification = {
|
||||||
create = function()
|
create = function()
|
||||||
return notification
|
return notification
|
||||||
|
|||||||
Reference in New Issue
Block a user