-
Notifications
You must be signed in to change notification settings - Fork 12
/
display_windows.go
46 lines (43 loc) · 1.31 KB
/
display_windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//go:build windows
// +build windows
package display
// WatchResize redisplays the interface on terminal resize events on Windows.
// Currently not implemented, see related issue in repo: too buggy right now.
func WatchResize(eng *Engine) chan<- bool {
return make(chan<- bool)
// resizeChannel := core.GetTerminalResize(eng.keys)
// for {
// select {
// case <-resizeChannel:
// // Weird behavior on Windows: when there is no autosuggested line,
// // the cursor moves at the end of the completions area, if non-empty.
// // We must manually go back to the input cursor position first.
// line, _ := eng.completer.Line()
// if eng.completer.IsInserting() {
// eng.suggested = *eng.line
// } else {
// eng.suggested = eng.histories.Suggest(eng.line)
// }
//
// if eng.suggested.Len() <= line.Len() {
// fmt.Println(term.HideCursor)
//
// compRows := completion.Coordinates(eng.completer)
// if compRows <= eng.AvailableHelperLines() {
// compRows++
// }
//
// term.MoveCursorBackwards(term.GetWidth())
// term.MoveCursorUp(compRows)
// term.MoveCursorUp(ui.CoordinatesHint(eng.hint))
// eng.cursorHintToLineStart()
// eng.lineStartToCursorPos()
// fmt.Println(term.ShowCursor)
// }
//
// eng.Refresh()
// case <-done:
// return
// }
// }
}