function(sel, range) {
            var ranges = sel.getAllRanges();
            sel.removeAllRanges();
            for (var i = 0, len = ranges.length; i < len; ++i) {
                if (!rangesEqual(range, ranges[i])) {
                    sel.addRange(ranges[i]);
                }
            }
            if (!sel.rangeCount) {
                updateEmptySelection(sel);
            }
        }
function(sel, range) {
            var ranges = sel.getAllRanges();
            sel.removeAllRanges();
            for (var i = 0, len = ranges.length; i < len; ++i) {
                if (!rangesEqual(range, ranges[i])) {
                    sel.addRange(ranges[i]);
                }
            }
            if (!sel.rangeCount) {
                updateEmptySelection(sel);
            }
        }
function ( sel , range ) { var ranges = sel . getAllRanges ( ) ; sel . removeAllRanges ( ) ; for ( var i = 0 , len = ranges . length ; i < len ; ++ i ) { if ( ! rangesEqual ( range , ranges [ i ] ) ) { sel . addRange ( ranges [ i ] ) ; } } if ( ! sel . rangeCount ) { updateEmptySelection ( sel ) ; } }
Removal of a single range
Removal of a single range
update the selection