diff options
author | Araq <rumpf_a@web.de> | 2011-02-07 00:04:31 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-02-07 00:04:31 +0100 |
commit | 77d045b3ac9218d084b27586b2f1dea23042d2b2 (patch) | |
tree | 6b344022df42d60c2396b8141598a350e9318495 /lib/pure/terminal.nim | |
parent | 783273032f13a504f16cf5bb68381e3d601c52d0 (diff) | |
download | Nim-77d045b3ac9218d084b27586b2f1dea23042d2b2.tar.gz |
bugfix terminal compiles for windows again
Diffstat (limited to 'lib/pure/terminal.nim')
-rwxr-xr-x | lib/pure/terminal.nim | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/pure/terminal.nim b/lib/pure/terminal.nim index 42bd80cb4..cd6e5bdd4 100755 --- a/lib/pure/terminal.nim +++ b/lib/pure/terminal.nim @@ -22,7 +22,7 @@ when defined(windows): # = createFile("CONOUT$", GENERIC_WRITE, 0, nil, OPEN_ALWAYS, 0, 0) block: - var hTemp = GetStdHandle(STD_OUTPUT_HANDLE()) + var hTemp = GetStdHandle(STD_OUTPUT_HANDLE) if DuplicateHandle(GetCurrentProcess(), hTemp, GetCurrentProcess(), addr(conHandle), 0, 1, DUPLICATE_SAME_ACCESS) == 0: OSError() @@ -54,9 +54,9 @@ proc setCursorPos*(x, y: int) = if SetConsoleCursorPosition(conHandle, c) == 0: OSError() else: stdout.write("\e[" & $y & ';' & $x & 'f') - + proc setCursorXPos*(x: int) = - ## sets the terminal's cursor to the x position. The y position is + ## sets the terminal's cursor to the x position. The y position is ## not changed. when defined(windows): var scrbuf: TCONSOLE_SCREEN_BUFFER_INFO @@ -64,13 +64,13 @@ proc setCursorXPos*(x: int) = if GetConsoleScreenBufferInfo(hStdout, addr(scrbuf)) == 0: OSError() var origin = scrbuf.dwCursorPosition origin.x = int16(x) - if SetConsoleCursorPosition(conHandle, origin) == 0: OSError() + if SetConsoleCursorPosition(conHandle, origin) == 0: OSError() else: stdout.write("\e[" & $x & 'G') - -when defined(windows): + +when defined(windows): proc setCursorYPos*(y: int) = - ## sets the terminal's cursor to the y position. The x position is + ## sets the terminal's cursor to the y position. The x position is ## not changed. **Warning**: This is not supported on UNIX! when defined(windows): var scrbuf: TCONSOLE_SCREEN_BUFFER_INFO @@ -78,7 +78,7 @@ when defined(windows): if GetConsoleScreenBufferInfo(hStdout, addr(scrbuf)) == 0: OSError() var origin = scrbuf.dwCursorPosition origin.y = int16(y) - if SetConsoleCursorPosition(conHandle, origin) == 0: OSError() + if SetConsoleCursorPosition(conHandle, origin) == 0: OSError() else: nil @@ -168,7 +168,7 @@ proc EraseLine* = scrbuf.dwCursorPosition, addr(numwrote)) == 0: OSError() else: - stdout.write("\e[2K") + stdout.write("\e[2K") setCursorXPos(0) proc EraseScreen* = |