feat: add more bugs

This commit is contained in:
JuanZoran
2023-01-09 21:30:16 +08:00
parent fef956e36d
commit 67c6ffa989
20 changed files with 149 additions and 144 deletions

View File

@@ -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

View File

@@ -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 = {

View File

@@ -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