begin pseudocode to reselect substring

to reselect initial substring after stylizing operations