<commit_before>hljs.initHighlightingOnLoad();

var css_link = document.getElementById('css_theme');

chrome.storage.local.get({ 'clearCodeOptions': { highlighter_options: { css_theme: 'default.css' }}}, function (response) {
  css_link.href = 'highlight/styles/' + response.clearCodeOptions.highlighter_options.css_theme;
});

chrome.storage.onChanged.addListener(function(changes, namespace) {
  if (namespace !== 'local' || !changes.clearCodeOptions ) { return; }

  css_link.href = 'highlight/styles/' + changes.clearCodeOptions.newValue.highlighter_options.css_theme;
  css_link.display = 'block';
});
<commit_msg>added css repaint when selecting theme from drop down<commit_after>hljs.initHighlightingOnLoad();

var css_link = document.getElementById('css_theme');

chrome.storage.local.get({ 'clearCodeOptions': { highlighter_options: { css_theme: 'default.css' }}}, function (response) {
  css_link.href = 'highlight/styles/' + response.clearCodeOptions.highlighter_options.css_theme;
});

chrome.storage.onChanged.addListener(function(changes, namespace) {
  if (namespace !== 'local' || !changes.clearCodeOptions ) { return; }

  css_link.href = 'highlight/styles/' + changes.clearCodeOptions.newValue.highlighter_options.css_theme;

  // force css repaint after href updated, needed for browsing theme drop down with arrow keys.
  setTimeout(function () {
    css_link.style.display = 'block';
  }, 50);
});

{'fraction_non_alphanumeric': 0.1389280677009873, 'fraction_numerical': 0.0014104372355430183, 'mean_word_length': 5.990147783251231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1818537', 'n_tokens_mistral': 437, 'n_tokens_neox': 423, 'n_words': 77}