config/lua: add noop

This commit is contained in:
Vaxry 2026-05-01 12:50:51 +01:00
parent e2ba19535d
commit 241eeae51a
No known key found for this signature in database
2 changed files with 11 additions and 0 deletions

View file

@ -793,6 +793,7 @@ local __HL_API = {}
---@field force_renderer_reload fun(...): any
---@field global fun(...): any
---@field layout fun(...): any
---@field no_op fun(...): any
---@field pass fun(...): any
---@field send_key_state fun(...): any
---@field send_shortcut fun(...): any

View file

@ -1093,6 +1093,15 @@ static int hlFocus(lua_State* L) {
return Internal::configError(L, "hl.focus: unrecognized arguments. Expected one of: direction, monitor, window, urgent_or_last, last");
}
static int dsp_noop(lua_State* L) {
return 0;
}
static int hlNoop(lua_State* L) {
lua_pushcclosure(L, dsp_noop, 0);
return 1;
}
static int dsp_toggleSpecial(lua_State* L) {
std::string name = lua_isnil(L, lua_upvalueindex(1)) ? "" : lua_tostring(L, lua_upvalueindex(1));
const auto& [workspaceID, workspaceName, isAutoID] = getWorkspaceIDNameFromString("special:" + name);
@ -1266,6 +1275,7 @@ void Internal::registerDispatcherBindings(lua_State* L) {
Internal::setFn(L, "force_renderer_reload", hlForceRendererReload);
Internal::setFn(L, "force_idle", hlForceIdle);
Internal::setFn(L, "focus", hlFocus);
Internal::setFn(L, "no_op", hlNoop);
}
lua_setfield(L, -2, "dsp");