code: function setGuttersForLineNumbers(options) {
      var found = false;
      for (var i = 0; i < options.gutters.length; ++i) {
        if (options.gutters[i] == "CodeMirror-linenumbers") {
          if (options.lineNumbers) found = true;
          else options.gutters.splice(i--, 1);
        }
      }
      if (!found && options.lineNumbers)
        options.gutters.push("CodeMirror-linenumbers");
    }
docs: Make sure the gutters options contains the element "CodeMirror-linenumbers" when the lineNumbers option is true.