<commit_before>// --------------------------------------------------------
// > Sidebar interface
//
// Display the search bar clicking on the magnify icon
$('.sidebar').on('click', '.search_icon', function() {
  Ui.toggleSearchBar();
});

// --------------------------------------------------------
// >> Manage search
//
// Hide the search bar clicking on the left chevron.
$('.sidebar').on('click', '.search .left', function() {
  Ui.toggleSearchBar();
});

// Display/hide search options click on the plus.
$('.sidebar').on('click', '.search .right', function() {
  $('.search .search-options').slideToggle();
});

// Manage key-up events for the search bar:
//   - Hide search bar pressing esc.
//   - Trigger the search pressing return;
$('.sidebar').on('keyup', '.search input', function(e) {
  // 27: 'esc' key
  // 13: 'Enter' key

  if (e.keyCode == 27) {
    Ui.toggleSearchBar();
  } else if (e.keyCode == 13) {
    var source = $('input[name="source"]:checked').val();
    var module = Cache.current.module;

    if (module == 'meta')
      return;

    Cache.search = {
      query:  $(this).val(),
      source: source
    };

    MetaController.render(module, 'search_results');
  }
});<commit_msg>Fix the search feature<commit_after>// --------------------------------------------------------
// > Sidebar interface
//
// Display the search bar clicking on the magnify icon
$('.sidebar').on('click', '.search_icon', function() {
  Ui.toggleSearchBar();
});

// --------------------------------------------------------
// >> Manage search
//
// Hide the search bar clicking on the left chevron.
$('.sidebar').on('click', '.search .left', function() {
  Ui.toggleSearchBar();
});

// Display/hide search options click on the plus.
$('.sidebar').on('click', '.search .right', function() {
  $('.search .search-options').slideToggle();
});

// Manage key-up events for the search bar:
//   - Hide search bar pressing esc.
//   - Trigger the search pressing return;
$('.sidebar').on('keyup', '.search input', function(e) {
  // 27: 'esc' key
  // 13: 'Enter' key

  if (e.keyCode == 27) {
    Ui.toggleSearchBar();
  } else if (e.keyCode == 13) {
    var source = $('input[name="source"]:checked').val();
    var module = Cache.current.module;

    if (module == 'meta')
      return;

    Cache.search = {
      query:  $(this).val(),
      source: source
    };

    Controller.for(module).searchResults();
  }
});
{'fraction_non_alphanumeric': 0.2742998352553542, 'fraction_numerical': 0.006589785831960461, 'mean_word_length': 2.1382428940568476, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3505243', 'n_tokens_mistral': 729, 'n_tokens_neox': 692, 'n_words': 196}