(g *gocui.Gui)
| 174 | } |
| 175 | |
| 176 | func (ls *labelSelect) focusView(g *gocui.Gui) error { |
| 177 | if ls.selected < 0 { |
| 178 | return nil |
| 179 | } |
| 180 | |
| 181 | _, lsy0, _, lsy1, err := g.ViewPosition(labelSelectView) |
| 182 | if err != nil { |
| 183 | return err |
| 184 | } |
| 185 | |
| 186 | _, vy0, _, vy1, err := g.ViewPosition(fmt.Sprintf("labeledit%d", ls.selected)) |
| 187 | if err != nil { |
| 188 | return err |
| 189 | } |
| 190 | |
| 191 | // Below bottom of frame |
| 192 | if vy1 > lsy1 { |
| 193 | ls.scroll += vy1 - lsy1 |
| 194 | return nil |
| 195 | } |
| 196 | |
| 197 | // Above top of frame |
| 198 | if vy0 < lsy0 { |
| 199 | ls.scroll -= lsy0 - vy0 |
| 200 | } |
| 201 | |
| 202 | return nil |
| 203 | } |
| 204 | |
| 205 | func (ls *labelSelect) selectPrevious(g *gocui.Gui, v *gocui.View) error { |
| 206 | if ls.selected < 0 { |
no outgoing calls
no test coverage detected