summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-03 10:22:15 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-03 10:22:15 (GMT)
commit2c4d43082cb7c1147302f559ad623f5deb22afd0 (patch)
tree0778c3115e31f0cd54f011ce9c674f8365b76b8d /win32/win32.c
parent7ac29740a11541cedf7122e28851036f790796db (diff)
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c
index a997cb3..d5b2fd7 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -6737,9 +6737,11 @@ constat_apply(HANDLE handle, struct constat *s, WCHAR w)
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':