Skip to content

Commit

Permalink
Merge pull request #42 from ncw/fix-40
Browse files Browse the repository at this point in the history
Make move to start of line with 0 parameter work - Fixes #40
  • Loading branch information
mattn committed Sep 30, 2019
2 parents 7c3dac0 + e779644 commit b568324
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions colorable_windows.go
Expand Up @@ -565,6 +565,9 @@ loop:
if err != nil {
continue
}
if n < 1 {
n = 1
}
procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
csbi.cursorPosition.x = short(n - 1)
procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
Expand Down

0 comments on commit b568324

Please sign in to comment.