From owner-svn-src-all@freebsd.org Fri Feb 23 04:12:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A93EF25515; Fri, 23 Feb 2018 04:12:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AF566B0B4; Fri, 23 Feb 2018 04:12:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25CC4118DE; Fri, 23 Feb 2018 04:12:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1N4CK7W058708; Fri, 23 Feb 2018 04:12:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1N4CKTi058707; Fri, 23 Feb 2018 04:12:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802230412.w1N4CKTi058707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 23 Feb 2018 04:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329861 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Feb 2018 04:12:20 -0000 Author: kevans Date: Fri Feb 23 04:12:19 2018 New Revision: 329861 URL: https://svnweb.freebsd.org/changeset/base/329861 Log: lualoader: Track effective line number, use it for drawing Takes into account hidden entries, so that we don't draw blank lines in place of a hidden item. Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Fri Feb 23 04:06:15 2018 (r329860) +++ head/stand/lua/drawer.lua Fri Feb 23 04:12:19 2018 (r329861) @@ -273,6 +273,7 @@ function drawer.drawmenu(m) local alias_table = {} local entry_num = 0 local menu_entries = m.entries + local effective_line_num = 0 if type(menu_entries) == "function" then menu_entries = menu_entries() end @@ -282,9 +283,10 @@ function drawer.drawmenu(m) if e.visible ~= nil and not e.visible() then goto continue end + effective_line_num = effective_line_num + 1 if e.entry_type ~= core.MENU_SEPARATOR then entry_num = entry_num + 1 - screen.setcursor(x, y + line_num) + screen.setcursor(x, y + effective_line_num) print(entry_num .. ". " .. menu_entry_name(m, e)) @@ -296,7 +298,7 @@ function drawer.drawmenu(m) end end else - screen.setcursor(x, y + line_num) + screen.setcursor(x, y + effective_line_num) print(menu_entry_name(m, e)) end ::continue::