<commit_before>function nextEditor(doc, id) {
  pos = doc.ids.indexOf(id);
  // TODO find next undeleted one
  //console.log("next editor at position: " + (pos+1) + " with id: " + doc.ids[pos+1]);
  return doc.cells[doc.ids[pos+1]].editor;
}

function prevEditor(doc, id) {
  pos = doc.ids.indexOf(id);
  // TODO find prev undeleted one
  //console.log("prev editor at position: " + (pos-1) + " with id: " + doc.ids[pos-1]);
  return doc.cells[doc.ids[pos-1]].editor;
}<commit_msg>cursor respects proper cell order, visibility, and ace-editorness<commit_after>function nextEditor(doc, id) {
  pos = doc.ids.indexOf(id);
  // find next undeleted one
  pos = pos + 1;
  while(pos < doc.ids.length
  && !((doc.ids[pos] in doc.cells)
    && typeof(doc.cells[doc.ids[pos]].editor.getCursorPosition)=='function'
    && doc.cells[doc.ids[pos]].showEditor)) {
    pos += 1
  }
  if(pos >= doc.ids.length) return undefined;
  else return doc.cells[doc.ids[pos]].editor;
}

function prevEditor(doc, id) {
  pos = doc.ids.indexOf(id);
  // find prev undeleted one
  pos = pos - 1;
  while(pos >= 0 && !((doc.ids[pos] in doc.cells)
        && typeof(doc.cells[doc.ids[pos]].editor.getCursorPosition)=='function'
        && doc.cells[doc.ids[pos]].showEditor)) {
    pos -= 1
  }
  if(pos < 0) return undefined;
  else return doc.cells[doc.ids[pos]].editor;
}
{'fraction_non_alphanumeric': 0.18202080237741455, 'fraction_numerical': 0.008915304606240713, 'mean_word_length': 3.5816326530612246, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5804133', 'n_tokens_mistral': 513, 'n_tokens_neox': 487, 'n_words': 103}