function updateIndent(str, state) {
  /*jshint -W004*/
  var indentBy = state.indentBy;
  if (indentBy < 0) {
    for (var i = 0; i < -indentBy; i++) {
      str = str.replace(leadingIndentRegexp, '$1');
    }
  } else {
    for (var i = 0; i < indentBy; i++) {
      str = str.replace(leadingIndentRegexp, '$1$2$2');
    }
  }
  return str;
}
Update indent using state.indentBy property. Indent is measured in
double spaces. Updates a single line only.

@param {string} str
@param {object} state
@return {string}