JoinNextLine joins the next line to the current one by deleting the line ending after the current line.
(separator string)
| 163 | |
| 164 | // JoinNextLine joins the next line to the current one by deleting the line ending after the current line. |
| 165 | func (b *Buffer) JoinNextLine(separator string) { |
| 166 | if !b.Document().OnLastLine() { |
| 167 | b.cursorPosition += b.Document().GetEndOfLinePosition() |
| 168 | b.Delete(1) |
| 169 | // Remove spaces |
| 170 | b.setText(b.Document().TextBeforeCursor() + separator + strings.TrimLeft(b.Document().TextAfterCursor(), " ")) |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | // SwapCharactersBeforeCursor swaps the last two characters before the cursor. |
| 175 | func (b *Buffer) SwapCharactersBeforeCursor() { |