From f0cd6845f16de9b6b55925b31e68114c01be2b18 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 16 Jan 2018 00:26:07 +0800 Subject: improve select next and prev --- xmake/core/ui/panel.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xmake/core/ui/panel.lua b/xmake/core/ui/panel.lua index 17a35531e..5057fe2bc 100644 --- a/xmake/core/ui/panel.lua +++ b/xmake/core/ui/panel.lua @@ -201,8 +201,8 @@ function panel:select_next(start) -- select the next view local next = self:next(current) - while next and next ~= current do - if next:option("selectable") and next:state("visible") then + while next ~= current do + if next and next:option("selectable") and next:state("visible") then return self:select(next) end next = self:next(next) @@ -222,8 +222,8 @@ function panel:select_prev(start) -- select the previous view local prev = self:prev(current) - while prev and prev ~= current do - if prev:option("selectable") and prev:state("visible") then + while prev ~= current do + if prev and prev:option("selectable") and prev:state("visible") then return self:select(prev) end prev = self:prev(prev) -- cgit v1.3.1