<commit_before>CodeMirror.showHint = function(cm, getHints, options) {
  if (!options) options = {};
  
  function collectHints(startCh, continued) {
    // We want a single cursor position.
    if (cm.somethingSelected()) return;

    var token = cm.getTokenAt(cm.getCursor());

    var result = getHints(cm, options);
    if (!result || !result.list.length) return;
    var completions = result.list;
    // When there is only one completion, use it directly.
    if (!continued && options.completeSingle !== false && completions.length == 1) {
      cm.replaceRange(completions[0], result.from, result.to);
      return true;
    }

    // Build the select widget
    var hints = document.createElement("ul"), selectedHint = 0;
    hints.className = "CodeMirror-hints";
    for (var i = 0; i < completions.length; ++i) {
      var elt = hints.appendChild(document.createElement("li"));
      elt.className = "CodeMirror-hint" + (i ? "" : " CodeMirror-hint-active");
      elt.appendChild(document.createTextNode(completions[i]));
      elt.hintId = i;
    }
    var pos = cm.cursorCoords(options.alignWithWord !== false ? result.from : null);
    hints.style.left = pos.left + "px";
    hints.style.top = pos.bottom + "px";
    document.body.appendChild(hints);

    // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
    var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
    if (winW - pos.left < hints.clientWidth)
      hints.style.left = (pos.left - sel.clientWidth) + "px";

    function changeActive(i) {
      if (i < 0 || i >= completions.length || selectedHint == i) return;<commit_msg>[show-hint addon] Remove unused variable<commit_after>CodeMirror.showHint = function(cm, getHints, options) {
  if (!options) options = {};
  
  function collectHints(startCh, continued) {
    // We want a single cursor position.
    if (cm.somethingSelected()) return;

    var result = getHints(cm, options);
    if (!result || !result.list.length) return;
    var completions = result.list;
    // When there is only one completion, use it directly.
    if (!continued && options.completeSingle !== false && completions.length == 1) {
      cm.replaceRange(completions[0], result.from, result.to);
      return true;
    }

    // Build the select widget
    var hints = document.createElement("ul"), selectedHint = 0;
    hints.className = "CodeMirror-hints";
    for (var i = 0; i < completions.length; ++i) {
      var elt = hints.appendChild(document.createElement("li"));
      elt.className = "CodeMirror-hint" + (i ? "" : " CodeMirror-hint-active");
      elt.appendChild(document.createTextNode(completions[i]));
      elt.hintId = i;
    }
    var pos = cm.cursorCoords(options.alignWithWord !== false ? result.from : null);
    hints.style.left = pos.left + "px";
    hints.style.top = pos.bottom + "px";
    document.body.appendChild(hints);

    // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
    var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
    if (winW - pos.left < hints.clientWidth)
      hints.style.left = (pos.left - sel.clientWidth) + "px";

    function changeActive(i) {
      if (i < 0 || i >= completions.length || selectedHint == i) return;
{'fraction_non_alphanumeric': 0.13922553946201596, 'fraction_numerical': 0.0029559562518474726, 'mean_word_length': 3.235294117647059, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4190810', 'n_tokens_mistral': 1059, 'n_tokens_neox': 1011, 'n_words': 276}