wrappedLineNumber returns the wrapped line number (span index) and rune index within that span of the given character position within line in position, and false if out of range (last valid position returned in that case -- still usable).
(pos lexer.Pos)
| 44 | // within that span of the given character position within line in position, |
| 45 | // and false if out of range (last valid position returned in that case -- still usable). |
| 46 | func (ed *Editor) wrappedLineNumber(pos lexer.Pos) (si, ri int, ok bool) { |
| 47 | if pos.Ln >= len(ed.renders) { |
| 48 | return 0, 0, false |
| 49 | } |
| 50 | return ed.renders[pos.Ln].RuneSpanPos(pos.Ch) |
| 51 | } |
| 52 | |
| 53 | // setCursor sets a new cursor position, enforcing it in range. |
| 54 | // This is the main final pathway for all cursor movement. |
no test coverage detected