1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-26 15:30:04 +08:00
SpaceVim/lua/spacevim/api/vim/window.lua
2019-10-12 00:10:29 +08:00

28 lines
594 B
Lua

local window = {}
function window.get_cursor(window_id)
local winindex = vim.eval("win_id2win(" .. window_id .. ")")
local w = vim.window(winindex)
if w == nil then
vim.command("return [" .. table.concat({0, 0}, ", ") .. "]")
else
vim.command("return [" .. table.concat({w.line, w.col}, ", ") .. "]")
end
end
function window.set_cursor(window_id, pos)
local winindex = vim.eval("win_id2win(" .. window_id .. ")")
local w = vim.window(winindex)
w.line = pos[0]
w.col = pos[1]
end
function window.close(window_id)
end
return window