ruby-changes:47139
From: nobu <ko1@a...>
Date: Mon, 3 Jul 2017 19:22:19 +0900 (JST)
Subject: [ruby-changes:47139] nobu:r59254 (trunk): win32.c: cursor relative to screen
nobu 2017-07-03 19:22:15 +0900 (Mon, 03 Jul 2017) New Revision: 59254 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59254 Log: win32.c: cursor relative to screen * win32/win32.c (constat_apply): move relative to visible screen, not the entire buffer. [ruby-core:81883] [Bug #13707] Modified files: trunk/win32/win32.c Index: win32/win32.c =================================================================== --- win32/win32.c (revision 59253) +++ win32/win32.c (revision 59254) @@ -6737,9 +6737,11 @@ constat_apply(HANDLE handle, struct cons https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L6737 break; case L'H': case L'f': - pos.Y = (arg1 > csbi.dwSize.Y ? csbi.dwSize.Y : arg1) - 1; + pos.Y = arg1 + csbi.srWindow.Top - 1; + if (pos.Y > csbi.srWindow.Bottom) pos.Y = csbi.srWindow.Bottom; if (count < 2 || (arg1 = seq[1]) <= 0) arg1 = 1; - pos.X = (arg1 > csbi.dwSize.X ? csbi.dwSize.X : arg1) - 1; + pos.X = arg1 + csbi.srWindow.Left - 1; + if (pos.X > csbi.srWindow.Right) pos.X = csbi.srWindow.Right; SetConsoleCursorPosition(handle, pos); break; case L'J': -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/