diff options
Diffstat (limited to 'Godeps/_workspace/src/github.com/peterh/liner/output_windows.go')
-rw-r--r-- | Godeps/_workspace/src/github.com/peterh/liner/output_windows.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Godeps/_workspace/src/github.com/peterh/liner/output_windows.go b/Godeps/_workspace/src/github.com/peterh/liner/output_windows.go index 27ae55a14..45cd978c9 100644 --- a/Godeps/_workspace/src/github.com/peterh/liner/output_windows.go +++ b/Godeps/_workspace/src/github.com/peterh/liner/output_windows.go @@ -47,6 +47,24 @@ func (s *State) eraseScreen() { procSetConsoleCursorPosition.Call(uintptr(s.hOut), 0) } +func (s *State) moveUp(lines int) { + var sbi consoleScreenBufferInfo + procGetConsoleScreenBufferInfo.Call(uintptr(s.hOut), uintptr(unsafe.Pointer(&sbi))) + procSetConsoleCursorPosition.Call(uintptr(s.hOut), + uintptr(int(sbi.dwCursorPosition.x)&0xFFFF|(int(sbi.dwCursorPosition.y)-lines)<<16)) +} + +func (s *State) moveDown(lines int) { + var sbi consoleScreenBufferInfo + procGetConsoleScreenBufferInfo.Call(uintptr(s.hOut), uintptr(unsafe.Pointer(&sbi))) + procSetConsoleCursorPosition.Call(uintptr(s.hOut), + uintptr(int(sbi.dwCursorPosition.x)&0xFFFF|(int(sbi.dwCursorPosition.y)+lines)<<16)) +} + +func (s *State) emitNewLine() { + // windows doesn't need to omit a new line +} + func (s *State) getColumns() { var sbi consoleScreenBufferInfo procGetConsoleScreenBufferInfo.Call(uintptr(s.hOut), uintptr(unsafe.Pointer(&sbi))) |