Right now we use codemirror's JavaScript mode on the website but there's a JSX mode now so we should start using that instead.

if (to < pos.line) {
      pos.line += diff;
    } else if (from < pos.line) {
      pos.line = from;
      pos.ch = 0;
    }
  }
  
  
  
  
  
  
  
  function rebaseHistArray(array, from, to, diff) {