<commit_before>/**
 * Adds a Sublime-Text style quick-open file browser to PRs--using GitHub's own file picker!
 */
(function() {
  var keyPressListener;
  var prContent;
  var filePicker;

  Router.on('start:pr-files', function(prRef) {
    var files;

    // When opening a PR from the PR list, GitHub will take a moment to load the PR _after_ already
    // having changed the location.
    ElementUtils.waitForElement('.content', 3 * 1000)
      .done(function(fileList) {
        files = fileList.find('li > a').toArray().map(function(fileLink) {
          return {
            href: fileLink.href,
            name: fileLink.innerText
          };
        });

        keyPressListener = function(e) {
          if (e.keyCode !== 116 /* t */) return;
          if (filePicker) return;

          // Prevent the default not because GitHub has anything registered to this--it doesn't--
          // but so the 't' doesn't get entered into the file picker as we focus below.
          e.preventDefault();
          showFilePicker();
        };<commit_msg>Don't show the file picker when the user is typing in comments.<commit_after>/**
 * Adds a Sublime-Text style quick-open file browser to PRs--using GitHub's own file picker!
 */
(function() {
  var keyPressListener;
  var prContent;
  var filePicker;

  Router.on('start:pr-files', function(prRef) {
    var files;

    // When opening a PR from the PR list, GitHub will take a moment to load the PR _after_ already
    // having changed the location.
    ElementUtils.waitForElement('.content', 3 * 1000)
      .done(function(fileList) {
        files = fileList.find('li > a').toArray().map(function(fileLink) {
          return {
            href: fileLink.href,
            name: fileLink.innerText
          };
        });

        keyPressListener = function(e) {
          // Ignore typing in comments.
          if ($(e.target).closest('input, textarea, [contenteditable]').length) return;
          if (e.keyCode !== 116 /* t */) return;
          if (filePicker) return;

          // Prevent the default not because GitHub has anything registered to this--it doesn't--
          // but so the 't' doesn't get entered into the file picker as we focus below.
          e.preventDefault();
          showFilePicker();
        };
{'fraction_non_alphanumeric': 0.11246730601569312, 'fraction_numerical': 0.006974716652136007, 'mean_word_length': 2.2738944365192584, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1775193', 'n_tokens_mistral': 671, 'n_tokens_neox': 630, 'n_words': 218}