2023-06-26 00:18:50 +02:00
|
|
|
-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
-- License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
-- file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
2023-06-26 00:49:06 +02:00
|
|
|
--
|
|
|
|
-- SPDX-License-Identifier: MPL-2.0
|
2023-06-26 00:18:50 +02:00
|
|
|
|
2023-06-15 19:42:34 +02:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
---Close a window.
|
|
|
|
---@param client_id integer? The id of the window you want closed, or nil to close the currently focused window, if any.
|
|
|
|
function M.close_window(client_id)
|
|
|
|
SendMsg({
|
2023-06-18 04:02:58 +02:00
|
|
|
CloseWindow = {
|
2023-06-21 21:48:38 +02:00
|
|
|
client_id = client_id,
|
2023-06-15 19:42:34 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2023-06-19 02:30:52 +02:00
|
|
|
---Toggle a window's floating status.
|
|
|
|
---@param client_id integer? The id of the window you want to toggle, or nil to toggle the currently focused window, if any.
|
|
|
|
function M.toggle_floating(client_id)
|
|
|
|
SendMsg({
|
|
|
|
ToggleFloating = {
|
2023-06-21 21:48:38 +02:00
|
|
|
client_id = client_id,
|
2023-06-19 02:30:52 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2023-06-15 19:42:34 +02:00
|
|
|
return M
|