fix: fix float window style

This commit is contained in:
JuanZoran
2023-01-31 23:17:03 +08:00
parent 50ff4980ef
commit 86f8b7f6e8
10 changed files with 198 additions and 192 deletions

View File

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

View File

@ -0,0 +1,6 @@
---判断单词是否含有中文
---@param word string 需要判断的单词
---@return boolean 判断结果
return function (word)
return false
end