Gets the number of characters in the buffer (which is the same as the last caret position in the buffer).