If text is selected, the replace operation should only apply to the selected text, not the entire module.