()
| 378 | } |
| 379 | |
| 380 | func (h *BufPane) initialRelocate() { |
| 381 | sloc := h.SLocFromLoc(h.Cursor.Loc) |
| 382 | height := h.BufView().Height |
| 383 | |
| 384 | // If the initial cursor location is far away from the beginning |
| 385 | // of the buffer, ensure the cursor is at 25% of the window height |
| 386 | v := h.GetView() |
| 387 | if h.Diff(display.SLoc{0, 0}, sloc) < height { |
| 388 | v.StartLine = display.SLoc{0, 0} |
| 389 | } else { |
| 390 | v.StartLine = h.Scroll(sloc, -height/4) |
| 391 | h.ScrollAdjust() |
| 392 | } |
| 393 | v.StartCol = 0 |
| 394 | h.Relocate() |
| 395 | } |
| 396 | |
| 397 | // ID returns this pane's split id. |
| 398 | func (h *BufPane) ID() uint64 { |
no test coverage detected