| @@ -590,14 +590,18 @@ fn luaClientToggleFloating(state: ?*c.lua_State) callconv(.c) c_int { |
| 590 |
|
590 |
|
| 591 |
fn luaClientFocusStack(state: ?*c.lua_State) callconv(.c) c_int { |
591 |
fn luaClientFocusStack(state: ?*c.lua_State) callconv(.c) c_int { |
| 592 |
const s = state orelse return 0; |
592 |
const s = state orelse return 0; |
| 593 |
- const dir: i32 = @intCast(c.lua_tointegerx(s, 1, null)); |
593 |
+ var isnum: c_int = 0; |
|
|
594 |
+ const raw = c.lua_tointegerx(s, 1, &isnum); |
|
|
595 |
+ const dir: i32 = if (isnum != 0) @intCast(raw) else 1; |
| 594 |
createActionTableWithInt(s, "FocusStack", dir); |
596 |
createActionTableWithInt(s, "FocusStack", dir); |
| 595 |
return 1; |
597 |
return 1; |
| 596 |
} |
598 |
} |
| 597 |
|
599 |
|
| 598 |
fn luaClientMoveStack(state: ?*c.lua_State) callconv(.c) c_int { |
600 |
fn luaClientMoveStack(state: ?*c.lua_State) callconv(.c) c_int { |
| 599 |
const s = state orelse return 0; |
601 |
const s = state orelse return 0; |
| 600 |
- const dir: i32 = @intCast(c.lua_tointegerx(s, 1, null)); |
602 |
+ var isnum: c_int = 0; |
|
|
603 |
+ const raw = c.lua_tointegerx(s, 1, &isnum); |
|
|
604 |
+ const dir: i32 = if (isnum != 0) @intCast(raw) else 1; |
| 601 |
createActionTableWithInt(s, "MoveStack", dir); |
605 |
createActionTableWithInt(s, "MoveStack", dir); |
| 602 |
return 1; |
606 |
return 1; |
| 603 |
} |
607 |
} |