AddLineToSelection adds the current line to the selection
()
| 227 | |
| 228 | // AddLineToSelection adds the current line to the selection |
| 229 | func (c *Cursor) AddLineToSelection() { |
| 230 | if c.Loc.LessThan(c.OrigSelection[0]) { |
| 231 | c.Start() |
| 232 | c.SetSelectionStart(c.Loc) |
| 233 | c.SetSelectionEnd(c.OrigSelection[1]) |
| 234 | } |
| 235 | if c.Loc.GreaterThan(c.OrigSelection[1]) { |
| 236 | c.End() |
| 237 | c.SetSelectionEnd(c.Loc.Move(1, c.buf)) |
| 238 | c.SetSelectionStart(c.OrigSelection[0]) |
| 239 | } |
| 240 | |
| 241 | if c.Loc.LessThan(c.OrigSelection[1]) && c.Loc.GreaterThan(c.OrigSelection[0]) { |
| 242 | c.CurSelection = c.OrigSelection |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | // UpN moves the cursor up N lines (if possible) |
| 247 | func (c *Cursor) UpN(amount int) { |
no test coverage detected