MCPcopy Index your code
hub / github.com/git-bug/git-bug / focusView

Method focusView

termui/label_select.go:176–203  ·  view source on GitHub ↗
(g *gocui.Gui)

Source from the content-addressed store, hash-verified

174}
175
176func (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
205func (ls *labelSelect) selectPrevious(g *gocui.Gui, v *gocui.View) error {
206 if ls.selected < 0 {

Callers 3

selectPreviousMethod · 0.95
selectNextMethod · 0.95
addItemMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected