diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-11-03 00:22:53 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-11-03 16:32:57 +0800 |
commit | bad0de0dcbae82d96f68d1eec1701042d5dfa985 (patch) | |
tree | 7b6e585f47a0c4bb9f6e3a17d549ca1d0ddbd642 /vendor/github.com/mattn | |
parent | 3b62c145f8d699767e13770d1bb21d07c2ba9b46 (diff) | |
download | dexon-bad0de0dcbae82d96f68d1eec1701042d5dfa985.tar.gz dexon-bad0de0dcbae82d96f68d1eec1701042d5dfa985.tar.zst dexon-bad0de0dcbae82d96f68d1eec1701042d5dfa985.zip |
vendor: pull in azure sdk and openpgp signer
Diffstat (limited to 'vendor/github.com/mattn')
-rw-r--r-- | vendor/github.com/mattn/go-colorable/colorable_windows.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vendor/github.com/mattn/go-colorable/colorable_windows.go b/vendor/github.com/mattn/go-colorable/colorable_windows.go index bc84adfaf..448277f56 100644 --- a/vendor/github.com/mattn/go-colorable/colorable_windows.go +++ b/vendor/github.com/mattn/go-colorable/colorable_windows.go @@ -72,6 +72,7 @@ type Writer struct { handle syscall.Handle lastbuf bytes.Buffer oldattr word + oldpos coord } func NewColorable(file *os.File) io.Writer { @@ -83,7 +84,7 @@ func NewColorable(file *os.File) io.Writer { var csbi consoleScreenBufferInfo handle := syscall.Handle(file.Fd()) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) - return &Writer{out: file, handle: handle, oldattr: csbi.attributes} + return &Writer{out: file, handle: handle, oldattr: csbi.attributes, oldpos: coord{0, 0}} } else { return file } @@ -644,6 +645,11 @@ loop: ci.visible = 0 procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) } + case 's': + procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + w.oldpos = csbi.cursorPosition + case 'u': + procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&w.oldpos))) } } return len(data) - w.lastbuf.Len(), nil |