Store the direct style properties of current selection so we could apply it to the newly insert text after removing the selction

At the moment replacing formatted text with new text will lose the formatting.