fix(ui): handle table wraparound on k binding
This commit is contained in:
parent
08a5690d30
commit
045498a2ce
@ -293,6 +293,13 @@ func (ui *UI) inputCaptureHandler(event *tcell.EventKey) *tcell.EventKey {
|
|||||||
return event
|
return event
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleKeyUp := func() {
|
||||||
|
row, _ := ui.destView.GetSelection()
|
||||||
|
if row == 1 {
|
||||||
|
ui.destView.Select(ui.destView.GetRowCount(), 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch event.Key() {
|
switch event.Key() {
|
||||||
case tcell.KeyRune:
|
case tcell.KeyRune:
|
||||||
switch event.Rune() {
|
switch event.Rune() {
|
||||||
@ -307,15 +314,14 @@ func (ui *UI) inputCaptureHandler(event *tcell.EventKey) *tcell.EventKey {
|
|||||||
ui.copyConfigFilePathToClipboard(ui.clipboardAvailable, ui.configFilePath)
|
ui.copyConfigFilePathToClipboard(ui.clipboardAvailable, ui.configFilePath)
|
||||||
case '?':
|
case '?':
|
||||||
ui.showAbout()
|
ui.showAbout()
|
||||||
|
case 'k': // tview vim bindings
|
||||||
|
handleKeyUp()
|
||||||
}
|
}
|
||||||
case tcell.KeyDelete, tcell.KeyBackspace, tcell.KeyBackspace2:
|
case tcell.KeyDelete, tcell.KeyBackspace, tcell.KeyBackspace2:
|
||||||
ui.removeDestination()
|
ui.removeDestination()
|
||||||
return nil
|
return nil
|
||||||
case tcell.KeyUp:
|
case tcell.KeyUp:
|
||||||
row, _ := ui.destView.GetSelection()
|
handleKeyUp()
|
||||||
if row == 1 {
|
|
||||||
ui.destView.Select(ui.destView.GetRowCount(), 0)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return event
|
return event
|
||||||
|
Loading…
x
Reference in New Issue
Block a user