Spent about five years fiddling around with currentXPosition within the backspace function before realizing I could just use the buffer itself as a starting point. Backspace now works correctly, at least until I attempt to wrap text.