Windows: fix a eraseLine bug (#7044)
This commit is contained in:
parent
2c9e56a783
commit
b6b99da08f
1 changed files with 2 additions and 3 deletions
|
|
@ -391,12 +391,11 @@ proc eraseLine*(f: File) =
|
||||||
origin.X = 0'i16
|
origin.X = 0'i16
|
||||||
if setConsoleCursorPosition(h, origin) == 0:
|
if setConsoleCursorPosition(h, origin) == 0:
|
||||||
raiseOSError(osLastError())
|
raiseOSError(osLastError())
|
||||||
var ht: DWORD = scrbuf.dwSize.Y - origin.Y
|
|
||||||
var wt: DWORD = scrbuf.dwSize.X - origin.X
|
var wt: DWORD = scrbuf.dwSize.X - origin.X
|
||||||
if fillConsoleOutputCharacter(h, ' ', ht*wt,
|
if fillConsoleOutputCharacter(h, ' ', wt,
|
||||||
origin, addr(numwrote)) == 0:
|
origin, addr(numwrote)) == 0:
|
||||||
raiseOSError(osLastError())
|
raiseOSError(osLastError())
|
||||||
if fillConsoleOutputAttribute(h, scrbuf.wAttributes, ht * wt,
|
if fillConsoleOutputAttribute(h, scrbuf.wAttributes, wt,
|
||||||
scrbuf.dwCursorPosition, addr(numwrote)) == 0:
|
scrbuf.dwCursorPosition, addr(numwrote)) == 0:
|
||||||
raiseOSError(osLastError())
|
raiseOSError(osLastError())
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue