Update indices of attributes in this for a change in the text they refer to.
The change that this function applies is removing
remove bytes at position
pos and inserting
Attributes that fall entirely in the (
remove) range are removed.
Attributes that start or end inside the (
remove) range are shortened to reflect the removal.
Attributes start and end positions are updated if they are behind
the position of the change
the number of removed bytes
the number of added bytes