From 7d6eed7e4199acb9c218f7d9994f883e027af212 Mon Sep 17 00:00:00 2001 From: Von Bravo Date: Mon, 16 Feb 2026 21:46:45 -0800 Subject: [PATCH] style: expand one-liner if/then/end blocks for stylua --- yazi-plugin/preset/components/current.lua | 12 +++++++++--- yazi-plugin/preset/components/root.lua | 4 +++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/yazi-plugin/preset/components/current.lua b/yazi-plugin/preset/components/current.lua index b82d61e9..312b91dc 100644 --- a/yazi-plugin/preset/components/current.lua +++ b/yazi-plugin/preset/components/current.lua @@ -51,11 +51,15 @@ end -- Mouse events 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 file = self._folder.window[y] - if not file then return end + if not file then + return + end local abs = self._folder.offset + y @@ -93,7 +97,9 @@ function Current:click(event, up) local files = self._folder.files for i = lo, hi do local f = files[i] - if f then urls[#urls + 1] = f.url end + if f then + urls[#urls + 1] = f.url + end end urls.state = "on" ya.emit("toggle_all", urls) diff --git a/yazi-plugin/preset/components/root.lua b/yazi-plugin/preset/components/root.lua index 16e92ade..3123325c 100644 --- a/yazi-plugin/preset/components/root.lua +++ b/yazi-plugin/preset/components/root.lua @@ -51,7 +51,9 @@ end -- Mouse events function Root:click(event, up) if tostring(cx.layer) ~= "mgr" then - if up then return end + if up then + return + end ya.emit(tostring(cx.layer) .. ":close", {}) end local c = ya.child_at(ui.Rect { x = event.x, y = event.y }, self:reflow())