Fix editing in the middle of a line.
Don’t move past the bounds of the buffer.