git: 65e3190d627f - stable/13 - loader: Fix 0 vs 1 confusion for column numbers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 28 Dec 2024 18:54:59 UTC
The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=65e3190d627feee3911f7aaf44d83c4368135795 commit 65e3190d627feee3911f7aaf44d83c4368135795 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2024-09-24 19:54:56 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-12-28 18:14:45 +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 (cherry picked from commit 604919c47fa4092db08dadd282851afc9cba0a90) --- 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 1d4c203bef40..9d228df1a9ad 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()