texthistory: fix calculation of n_chars
This should be the number of characters, not the end position. This fixes an issue where we wouldn't coalesce insert actions together.
This should be the number of characters, not the end position. This fixes an issue where we wouldn't coalesce insert actions together.