Skip to content

Commit 5ddab23

Browse files
committed
feat(#69): add Vim Keys scrolling to issue view
1 parent be8a154 commit 5ddab23

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

internal/issues/issue.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ func (view *issueView) HandleKeyEvent(ev *tcell.EventKey) {
152152
if view.fuzzyFind != nil {
153153
view.fuzzyFind.HandleKeyEvent(ev)
154154
}
155-
if ev.Key() == tcell.KeyUp {
155+
if ev.Key() == tcell.KeyUp || ev.Key() == tcell.KeyTab {
156156
view.scrollY = app.ClampInt(view.scrollY-1, 0, view.maxScrollY)
157157
}
158-
if ev.Key() == tcell.KeyDown {
158+
if ev.Key() == tcell.KeyDown || ev.Key() == tcell.KeyBacktab {
159159
view.scrollY = app.ClampInt(view.scrollY+1, 0, view.maxScrollY)
160160
}
161161
}

internal/issues/issue_test.go

+12
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,18 @@ func Test_fjiraIssueView_HandleKeyEvent(t *testing.T) {
294294

295295
// then
296296
assert2.Equal(t, 0, view.scrollY)
297+
298+
// when
299+
view.HandleKeyEvent(tcell.NewEventKey(tcell.KeyBacktab, 'k', tcell.ModNone))
300+
301+
// then
302+
assert2.Equal(t, 1, view.scrollY)
303+
304+
// and when
305+
view.HandleKeyEvent(tcell.NewEventKey(tcell.KeyTab, 'k', tcell.ModNone))
306+
307+
// then
308+
assert2.Equal(t, 0, view.scrollY)
297309
})
298310
}
299311
}

0 commit comments

Comments
 (0)