2
1
Fork 0

Compare commits

...

2 Commits

Author SHA1 Message Date
sloum 3a4d66220f Updates board 2021-03-26 19:54:25 -07:00
sloum 18ba29d42f Adds g and G to lane navigation and fixes an offset issue 2021-03-26 19:53:37 -07:00
2 changed files with 19 additions and 2 deletions

View File

@ -78,6 +78,23 @@ func (b *Board) Run() {
b.StoryOpen = true
b.ViewStory()
b.StoryOpen = false
case 'g':
if len(b.Lanes[b.Current].Stories) > 0 {
b.Lanes[b.Current].Current = 0
b.Lanes[b.Current].storyOff = 0
}
case 'G':
if len(b.Lanes[b.Current].Stories) > 0 {
b.Lanes[b.Current].Current = len(b.Lanes[b.Current].Stories)-1
if b.Lanes[b.Current].Current * 3 + 1 > b.height-5 {
off := b.Lanes[b.Current].Current - 3 % (b.height-5)
if off+1 > b.height-5 {
b.Lanes[b.Current].storyOff = off
} else {
b.Lanes[b.Current].storyOff = off+1
}
}
}
case 'h', 'j', 'k', 'l', 'H', 'L', 'K', 'J':
b.ClearMessage()
b.Move(ch)
@ -358,7 +375,7 @@ func (b *Board) Move(ch rune) {
// move selection down a story
if b.Lanes[b.Current].Current < len(b.Lanes[b.Current].Stories)-1 {
b.Lanes[b.Current].Current += 1
if b.Lanes[b.Current].Current * 3 + 1 > b.height-5 {
if b.Lanes[b.Current].Current * 3 + 1 - (b.Lanes[b.Current].storyOff*3) >= b.height-4 {
b.Lanes[b.Current].storyOff += 1
}
} else {

File diff suppressed because one or more lines are too long