feat: improve repository framework

This commit is contained in:
JuanZoran
2023-01-05 16:24:50 +08:00
parent 409d85f615
commit 033622ed85
16 changed files with 357 additions and 177 deletions

View File

@@ -0,0 +1,18 @@
local M = {}
--[[
content = {
lines = {} ---@type string[]
highlight = {}
}
--]]
---@param contents string[]
M.set = function (win, contents)
vim.validate {
contents = { contents, 'table' },
}
-- TODO
end
return M

View File

@@ -0,0 +1,29 @@
local M = {}
local api = vim.api
local util = require("Trans.window.util")
M.buf = util.init_buf()
--- 浮动窗口的风格
---@param conf table 自定义配置
M.show_float_win = function(conf)
vim.validate {
conf = { conf, 'table' },
}
local opts = util.get_float_opts(conf)
local win = api.nvim_open_win(M.buf, true, opts)
return win
end
M.show_cursor_win = function(conf)
vim.validate {
conf = { conf, 'table' },
}
local opts = util.get_cursor_opts(conf)
local win = api.nvim_open_win(M.buf, true, opts)
return win
end
-- TODO <++> more window style
return M

View File