Fix rangeReplace in src/tools/selection.js