code: function updateInViewport(cm, from, to) {
          var vp = cm.getViewport(), state = cm.state.foldGutter;
          from = isNaN(from) ? vp.from : from;
          to = isNaN(to) ? vp.to : to;
  
          if (!state) { return; }
          cm.operation(function () {
              updateFoldInfo(cm, from, to);
          });
          state.from = from;
          state.to = to;
      }
docs: Updates the fold information in the viewport for the specified range
  @param {CodeMirror} cm the instance of the CodeMirror object
  @param {?number} from the starting line number for the update
  @param {?number} to the end line number for the update