public void backspace() {
        TextGrid.DataGridCel cel;

        // Do nothing if we are at the beginning
        if (rowOffset + colOffset + currentCol + currentRow == 0) {
            return;
        }

        if ((currentCol + colOffset) == 0 && (currentRow + rowOffset) != 0) {
            // Get a \n in the previous line (user pressed backspace at the first character of the line)
            cel = grid.getCel(currentRow + rowOffset - 1, grid.getLineLength(currentRow + rowOffset - 1));

            if (currentRow > 0) {
                // Move cursor upwards
                currentRow--;
            } else {
                // Move up if we are at the top
                scrollUp();
            }

            // Go at the end of line
            end();

            int hack = colOffset;

            if (cel == null) {
                cel = grid.getCel(currentRow + rowOffset, currentCol - 1);
            }

            while (cel.getCharacter() != 0x0a) {
                cel = grid.getCel(currentRow + rowOffset, hack);
                hack++;
            }
        } else {
            // Get a single character
            cel = grid.getCel(currentRow + rowOffset, currentCol + colOffset - 1);
            if (colOffset > 0) {
                colOffset--;
            } else {
                currentCol--;
            }
        }
        // Remove the character
        grid.removeChar(cel.getBufferIndex());
    }