IsStartOfText returns whether the cursor is at the first non-whitespace rune of the line it is on
()
| 125 | // IsStartOfText returns whether the cursor is at the first |
| 126 | // non-whitespace rune of the line it is on |
| 127 | func (c *Cursor) IsStartOfText() bool { |
| 128 | x := 0 |
| 129 | for util.IsWhitespace(c.RuneUnder(x)) { |
| 130 | if x == util.CharacterCount(c.buf.LineBytes(c.Y)) { |
| 131 | break |
| 132 | } |
| 133 | x++ |
| 134 | } |
| 135 | return c.X == x |
| 136 | } |
| 137 | |
| 138 | // End moves the cursor to the end of the line it is on |
| 139 | func (c *Cursor) End() { |
no test coverage detected