feat: improve repository framework
This commit is contained in:
18
lua/Trans/window/content.lua
Normal file
18
lua/Trans/window/content.lua
Normal 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
|
29
lua/Trans/window/display.lua
Normal file
29
lua/Trans/window/display.lua
Normal 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
|
0
lua/Trans/window/init.lua
Normal file
0
lua/Trans/window/init.lua
Normal file
Reference in New Issue
Block a user