Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
go-to-k committed Aug 19, 2024
1 parent 2b7bb7b commit 00a79ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/io/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,12 @@ func (u *UI) View() string {
}

if len(contents) > SelectionPageSize {
if u.Cursor < SelectionPageSize/2 {
switch {
case u.Cursor < SelectionPageSize/2:
contents = contents[:SelectionPageSize]
} else if u.Cursor > len(u.Choices)-SelectionPageSize/2 {
case u.Cursor > len(u.Choices)-SelectionPageSize/2:
contents = contents[len(u.Choices)-SelectionPageSize:]
} else {
default:
contents = contents[u.Cursor-SelectionPageSize/2 : u.Cursor+SelectionPageSize/2]
}

Expand Down

0 comments on commit 00a79ce

Please sign in to comment.