backspace method
void
backspace()
Remove the selection or last char if the selection is empty
Implementation
void backspace() {
if (selection.start < selection.end) {
removeSelection();
} else {
removeChar();
}
}