<commit_before>$.extend($.ninjaui, {
  tabsToggle: function(customOptions){
    var options = $.extend({
      tabs:null,
      onChange:function(){},
      selected:null
    }, customOptions);
    $('.ninjauiTabsTab', options.tabs).each(function(i, tab) {
      if($(options.selected).attr('id') == $(tab).attr('id')){
        $(tab).addClass('ninjauiTabsClicked');        
      }
      else{
        $(tab).removeClass('ninjauiTabsClicked');
      }
    });
    options.onChange.call(options.selected);
  }
});

$.extend($.fn.ninjaui, {
  tabsCreate:function(customOptions) {
    var config = getConfig();
    var options = $.extend({
      id:null,
      onChange:function(){},
      selected:null
    }, customOptions);
    var origin = $(global.selected);
    var tabs = $(origin).wrapAll('<div/>').parent().addClass('ninjauiTabs').attr('id', options.id);
    $(origin).each(function(i, tab){
      $(tab).addClass('ninjauiTabsTab').click(function() {
        $.ninjaui.foldersToggle({folders:$(folders), onChange:options.onChange, selected:$(files)[i]});
      });
      var icon;
      if(icon = $(tab).attr('title')){
        title = $(tab).text();
        $(tab).removeAttr('title').html('<span/>');
        $('span', tab).ninjaui.iconCreate({icon:icon, title:title});
      }
    });
    $('.ninjauiTabsTab:first-child', tabs).addClass('ninjauiTabsFirst');
    $('.ninjauiTabsTab:last-child', tabs).addClass('ninjauiTabsLast');
    $.ninjaui.tabsToggle({tabs:$(tabs), onChange:options.onChange, selected:options.selected || $(tabs)[0].attr('id')});
    return $(tabs);
  }
});
<commit_msg>Fixes tab selection.<commit_after>$.extend($.ninjaui, {
  tabsToggle: function(customOptions){
    var options = $.extend({
      tabs:null,
      onChange:function(){},
      selected:null
    }, customOptions);
    $('.ninjauiTabsTab', options.tabs).each(function(i, tab) {
      if($(options.selected).attr('id') == $(tab).attr('id')){
        $(tab).addClass('ninjauiTabsClicked');        
      }
      else{
        $(tab).removeClass('ninjauiTabsClicked');
      }
    });
    options.onChange.call(options.selected);
  }
});

$.extend($.fn.ninjaui, {
  tabsCreate:function(customOptions) {
    var config = getConfig();
    var options = $.extend({
      id:null,
      onChange:function(){},
      selected:null
    }, customOptions);
    var origin = $(global.selected);
    var tabs = $(origin).wrapAll('<div/>').parent().addClass('ninjauiTabs').attr('id', options.id);
    $(origin).each(function(i, tab){
      $(tab).addClass('ninjauiTabsTab').click(function() {
        $.ninjaui.tabsToggle({onChange:options.onChange, selected:$(tab), tabs:$(tabs)});
      });
      var icon;
      if(icon = $(tab).attr('title')){
        title = $(tab).text();
        $(tab).removeAttr('title').html('<span/>');
        $('span', tab).ninjaui.iconCreate({icon:icon, title:title});
      }
    });
    $('.ninjauiTabsTab:first-child', tabs).addClass('ninjauiTabsFirst');
    $('.ninjauiTabsTab:last-child', tabs).addClass('ninjauiTabsLast');
    $.ninjaui.tabsToggle({onChange:options.onChange, selected:options.selected || $(tabs)[0], tabs:$(tabs)});
    return $(tabs);
  }
});

{'fraction_non_alphanumeric': 0.21370207416719045, 'fraction_numerical': 0.0006285355122564425, 'mean_word_length': 3.4269819193324063, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1076643', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1063, 'n_words': 130}