mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
style: expand one-liner if/then/end blocks for stylua
This commit is contained in:
parent
3139275c09
commit
7d6eed7e41
2 changed files with 12 additions and 4 deletions
|
|
@ -51,11 +51,15 @@ end
|
||||||
|
|
||||||
-- Mouse events
|
-- Mouse events
|
||||||
function Current:click(event, up)
|
function Current:click(event, up)
|
||||||
if up or event.is_middle then return end
|
if up or event.is_middle then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local y = event.y - self._area.y + 1
|
local y = event.y - self._area.y + 1
|
||||||
local file = self._folder.window[y]
|
local file = self._folder.window[y]
|
||||||
if not file then return end
|
if not file then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local abs = self._folder.offset + y
|
local abs = self._folder.offset + y
|
||||||
|
|
||||||
|
|
@ -93,7 +97,9 @@ function Current:click(event, up)
|
||||||
local files = self._folder.files
|
local files = self._folder.files
|
||||||
for i = lo, hi do
|
for i = lo, hi do
|
||||||
local f = files[i]
|
local f = files[i]
|
||||||
if f then urls[#urls + 1] = f.url end
|
if f then
|
||||||
|
urls[#urls + 1] = f.url
|
||||||
|
end
|
||||||
end
|
end
|
||||||
urls.state = "on"
|
urls.state = "on"
|
||||||
ya.emit("toggle_all", urls)
|
ya.emit("toggle_all", urls)
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,9 @@ end
|
||||||
-- Mouse events
|
-- Mouse events
|
||||||
function Root:click(event, up)
|
function Root:click(event, up)
|
||||||
if tostring(cx.layer) ~= "mgr" then
|
if tostring(cx.layer) ~= "mgr" then
|
||||||
if up then return end
|
if up then
|
||||||
|
return
|
||||||
|
end
|
||||||
ya.emit(tostring(cx.layer) .. ":close", {})
|
ya.emit(tostring(cx.layer) .. ":close", {})
|
||||||
end
|
end
|
||||||
local c = ya.child_at(ui.Rect { x = event.x, y = event.y }, self:reflow())
|
local c = ya.child_at(ui.Rect { x = event.x, y = event.y }, self:reflow())
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue