Skip to content

Commit

Permalink
Set boundary for Console.CursorTop
Browse files Browse the repository at this point in the history
  • Loading branch information
soimort authored and latkin committed Nov 22, 2014
1 parent 25d8ea0 commit 4f94347
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fsharp/fsi/console.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4f94347

Please sign in to comment.