fix: fix float window style
This commit is contained in:
@ -1,57 +1,55 @@
|
||||
local animation = {
|
||||
display = function(self)
|
||||
local callback = self.callback or function ()
|
||||
local display = function(self)
|
||||
local callback = self.callback or function()
|
||||
|
||||
end
|
||||
|
||||
if self.sync then
|
||||
local times = self.times
|
||||
if times then
|
||||
for i = 1, self.times do
|
||||
if self.run then
|
||||
self:frame(i)
|
||||
end
|
||||
end
|
||||
else
|
||||
while self.run do
|
||||
self:frame()
|
||||
end
|
||||
callback()
|
||||
end
|
||||
|
||||
if self.sync then
|
||||
local times = self.times
|
||||
if times then
|
||||
for i = 1, self.times do
|
||||
if self.run then
|
||||
self:frame(i)
|
||||
end
|
||||
else
|
||||
local frame
|
||||
if self.times then
|
||||
local target = self.times
|
||||
local times = 0
|
||||
frame = function()
|
||||
if self.run and times < target then
|
||||
times = times + 1
|
||||
self:frame(times)
|
||||
vim.defer_fn(frame, self.interval)
|
||||
else
|
||||
callback()
|
||||
end
|
||||
else
|
||||
while self.run do
|
||||
self:frame()
|
||||
end
|
||||
callback()
|
||||
end
|
||||
|
||||
else
|
||||
local frame
|
||||
if self.times then
|
||||
local target = self.times
|
||||
local times = 0
|
||||
frame = function()
|
||||
if self.run and times < target then
|
||||
times = times + 1
|
||||
self:frame(times)
|
||||
vim.defer_fn(frame, self.interval)
|
||||
else
|
||||
callback()
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
frame = function()
|
||||
if self.run then
|
||||
self:frame()
|
||||
vim.defer_fn(frame, self.interval)
|
||||
else
|
||||
callback()
|
||||
end
|
||||
frame = function()
|
||||
if self.run then
|
||||
self:frame()
|
||||
vim.defer_fn(frame, self.interval)
|
||||
else
|
||||
callback()
|
||||
end
|
||||
end
|
||||
frame()
|
||||
end
|
||||
end,
|
||||
}
|
||||
frame()
|
||||
end
|
||||
end
|
||||
|
||||
animation.__index = animation
|
||||
|
||||
return function(opts)
|
||||
opts.run = true
|
||||
return setmetatable(opts, animation)
|
||||
opts.display = display
|
||||
return opts
|
||||
end
|
||||
|
6
lua/Trans/util/is_Chinese.lua
Normal file
6
lua/Trans/util/is_Chinese.lua
Normal file
@ -0,0 +1,6 @@
|
||||
---判断单词是否含有中文
|
||||
---@param word string 需要判断的单词
|
||||
---@return boolean 判断结果
|
||||
return function (word)
|
||||
return false
|
||||
end
|
Reference in New Issue
Block a user