code: function ensureExpandState() {
          var state = ed.$expandRegionState;
          var pos = pToI(ed, ed.getCursorPosition());
          if (state
            // has cursor moved? invalidate expansion state
           && (state.range  [0] === pos || state.range[1] === pos)) 
             return state;
  
          var aceRange = ed.getSelectionRange();
          return ed.$expandRegionState = {
            range: [pToI(ed,aceRange.start), pToI(ed,aceRange.end)]
          };
        }
docs: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-