Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Sep 2024 20:18:14 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 604919c47fa4 - main - loader: Fix 0 vs 1 confusion for column numbers
Message-ID:  <202409242018.48OKIEvQ000605@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=604919c47fa4092db08dadd282851afc9cba0a90

commit 604919c47fa4092db08dadd282851afc9cba0a90
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-09-24 19:54:56 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-09-24 20:18:42 +0000

    loader: Fix 0 vs 1 confusion for column numbers
    
    In two places we use '0' for a column number. However, the upper left
    hand corner of the screen is 1, 1. Fix those two confusions. Also, fix
    a comment that flipped the coordinates in a comment (I'm used to the
    vt100 convention where it's row, column (eg y, x)) and didn't notice
    the rest of the code uses x, y.
    
    Sponsored by:           Netflix
    Differential Revision:  https://reviews.freebsd.org/D46777
---
 stand/lua/menu.lua   | 4 ++--
 stand/lua/screen.lua | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua
index 5820d80532b5..72f5648cae91 100644
--- a/stand/lua/menu.lua
+++ b/stand/lua/menu.lua
@@ -556,9 +556,9 @@ function menu.autoboot(delay)
 			else
 				-- Erase autoboot msg.  While real VT100s
 				-- wouldn't scroll when receiving a char with
-				-- the cursor at (24, 79), bad emulators do.
+				-- the cursor at (79, 24), bad emulators do.
 				-- Avoid the issue by stopping at 79.
-				screen.setcursor(0, y)
+				screen.setcursor(1, y)
 				printc(string.rep(" ", 79))
 				screen.defcursor()
 				return ch
diff --git a/stand/lua/screen.lua b/stand/lua/screen.lua
index 4437a34f95f1..89d5416815fd 100644
--- a/stand/lua/screen.lua
+++ b/stand/lua/screen.lua
@@ -32,7 +32,7 @@ local core = require("core")
 local screen = {}
 
 -- Module exports
-screen.default_x = 0
+screen.default_x = 1
 screen.default_y = 25
 
 function screen.clear()



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409242018.48OKIEvQ000605>