CursorToViewBottom moves the cursor to the bottom of the view, offset by scrollmargin unless at the beginning or end of the file
()
| 199 | // CursorToViewBottom moves the cursor to the bottom of the view, |
| 200 | // offset by scrollmargin unless at the beginning or end of the file |
| 201 | func (h *BufPane) CursorToViewBottom() bool { |
| 202 | v := h.GetView() |
| 203 | h.Buf.ClearCursors() |
| 204 | scrollmargin := int(h.Buf.Settings["scrollmargin"].(float64)) |
| 205 | bEnd := h.SLocFromLoc(h.Buf.End()) |
| 206 | lastLine := h.Scroll(v.StartLine, h.BufView().Height-1) |
| 207 | if lastLine == bEnd { |
| 208 | scrollmargin = 0 |
| 209 | } |
| 210 | h.Cursor.GotoLoc(h.LocFromVLoc(display.VLoc{ |
| 211 | SLoc: h.Scroll(lastLine, -scrollmargin), |
| 212 | VisualX: 0, |
| 213 | })) |
| 214 | return true |
| 215 | } |
| 216 | |
| 217 | // MoveCursorUp is not an action |
| 218 | func (h *BufPane) MoveCursorUp(n int) { |
nothing calls this directly
no test coverage detected