GetSelection returns the cursor's selection
()
| 202 | |
| 203 | // GetSelection returns the cursor's selection |
| 204 | func (c *Cursor) GetSelection() []byte { |
| 205 | if InBounds(c.CurSelection[0], c.buf) && InBounds(c.CurSelection[1], c.buf) { |
| 206 | if c.CurSelection[0].GreaterThan(c.CurSelection[1]) { |
| 207 | return c.buf.Substr(c.CurSelection[1], c.CurSelection[0]) |
| 208 | } |
| 209 | return c.buf.Substr(c.CurSelection[0], c.CurSelection[1]) |
| 210 | } |
| 211 | return []byte{} |
| 212 | } |
| 213 | |
| 214 | // SelectLine selects the current line |
| 215 | func (c *Cursor) SelectLine() { |
no test coverage detected