Some updates
This commit is contained in:
16
wdgt_cli.go
16
wdgt_cli.go
@@ -291,20 +291,20 @@ func (w *Cli) initKeyMap() {
|
||||
return true
|
||||
},
|
||||
tcell.KeyPgUp: func(ev *tcell.EventKey) bool {
|
||||
if w.historyPosition < len(w.log)-w.h-2 {
|
||||
w.historyPosition += (w.h - 2)
|
||||
if w.historyPosition > len(w.log) {
|
||||
w.historyPosition = len(w.log)
|
||||
if w.logPosition < len(w.log)-w.h-2 {
|
||||
w.logPosition += (w.h - 2)
|
||||
if w.logPosition > len(w.log) {
|
||||
w.logPosition = len(w.log)
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
tcell.KeyPgDn: func(ev *tcell.EventKey) bool {
|
||||
if w.historyPosition > 0 {
|
||||
w.historyPosition -= (w.h - 2)
|
||||
if w.historyPosition < 0 {
|
||||
w.historyPosition = 0
|
||||
if w.logPosition > 0 {
|
||||
w.logPosition -= (w.h - 2)
|
||||
if w.logPosition < 0 {
|
||||
w.logPosition = 0
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user