feat: add more bugs
This commit is contained in:
@@ -1,17 +1,12 @@
|
||||
local M = {}
|
||||
|
||||
|
||||
local buf_opts = {
|
||||
filetype = 'Trans'
|
||||
}
|
||||
|
||||
local buf = vim.api.nvim_create_buf(false, true)
|
||||
for k, v in pairs(buf_opts) do
|
||||
vim.api.nvim_buf_set_option(buf, k, v)
|
||||
end
|
||||
|
||||
M.buf = buf
|
||||
|
||||
M.group = vim.api.nvim_create_augroup('Trans', { clear = true })
|
||||
|
||||
M.augroup = vim.api.nvim_create_augroup('Trans', { clear = true })
|
||||
|
||||
return M
|
||||
|
@@ -15,8 +15,8 @@ M.conf = {
|
||||
},
|
||||
float = {
|
||||
border = 'rounded',
|
||||
width = 0.8,
|
||||
height = 0.9,
|
||||
width = 0.9,
|
||||
height = 0.8,
|
||||
},
|
||||
-- NOTE :如果你想限制某个组件的行数,可以设置 (名称与order相同)
|
||||
-- Example:
|
||||
@@ -91,6 +91,7 @@ M.conf = {
|
||||
},
|
||||
engine = {
|
||||
-- TODO
|
||||
'local',
|
||||
}
|
||||
},
|
||||
-- map = {
|
||||
|
@@ -40,8 +40,22 @@ end
|
||||
M.load_conf = function(conf)
|
||||
user_conf = conf or {}
|
||||
default_conf = require("Trans.conf.default").conf
|
||||
if user_conf.style and user_conf.window then
|
||||
end
|
||||
|
||||
pre_process()
|
||||
M.loaded_conf = vim.tbl_deep_extend('force', default_conf, user_conf)
|
||||
local width = M.loaded_conf.style.window.cursor.float.width
|
||||
local height = M.loaded_conf.style.window.cursor.float.height
|
||||
|
||||
if width > 0 and width <= 1 then
|
||||
M.loaded_conf.style.window.cursor.float.width = math.floor(width * vim.o.columns)
|
||||
end
|
||||
|
||||
if height > 0 and height <= 1 then
|
||||
M.loaded_conf.style.window.cursor.float.height = math.floor(height * (vim.o.lines - vim.o.cmdheight))
|
||||
end
|
||||
|
||||
user_conf = nil
|
||||
default_conf = nil
|
||||
end
|
||||
|
Reference in New Issue
Block a user