提交 4f943472 编写于 作者: M Mort Yao 提交者: latkin

Set boundary for Console.CursorTop

上级 25d8ea04
......@@ -131,7 +131,7 @@ module Utils =
type Cursor =
static member ResetTo(top,left) =
Utils.guard(fun () ->
Console.CursorTop <- top;
Console.CursorTop <- min top (Console.BufferHeight - 1);
Console.CursorLeft <- left)
static member Move(inset, delta) =
let position = Console.CursorTop * (Console.BufferWidth - inset) + (Console.CursorLeft - inset) + delta
......@@ -216,6 +216,7 @@ type ReadLineConsole() =
if currLeft < x.Inset then
if currLeft = 0 then Console.Write (if prompt then x.Prompt2 else String(' ',x.Inset))
Utils.guard(fun () ->
Console.CursorTop <- min Console.CursorTop (Console.BufferHeight - 1);
Console.CursorLeft <- x.Inset);
// The caller writes the primary prompt. If we are reading the 2nd and subsequent lines of the
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册