<commit_before>function plus(){
    document.getElementById('number').innerHTML =
      parseInt(document.getElementById('number').innerHTML) + 1;
}

function reset(){
    if(!confirm('Reset?')){
        return;
    }

    localStorage.removeItem('Plus.htm-number');
    document.getElementById('number').innerHTML = 0;
}

var unlocked = true;
document.getElementById('number').innerHTML =
  localStorage.getItem('Plus.htm-number') === null
    ? 0
    : localStorage.getItem('Plus.htm-number');

window.onbeforeunload = function(e){
    if(parseInt(document.getElementById('number').innerHTML) > 0){
        localStorage.setItem(
          'Plus.htm-number',
          document.getElementById('number').innerHTML
        );
    }
}

window.onkeydown = function(e){
    if(unlocked){
        unlocked = false;
        plus();
    }
};

window.onkeyup = function(e){
    unlocked = true;
};<commit_msg>added window prefix, improved formatting<commit_after>function plus(){
    document.getElementById('number').innerHTML =
      parseInt(document.getElementById('number').innerHTML) + 1;
}

function reset(){
    if(!confirm('Reset?')){
        return;
    }

    window.localStorage.removeItem('Plus.htm-number');
    document.getElementById('number').innerHTML = 0;
}

var unlocked = true;
document.getElementById('number').innerHTML =
  window.localStorage.getItem('Plus.htm-number') === null
    ? 0
    : window.localStorage.getItem('Plus.htm-number');

window.onbeforeunload = function(e){
    if(parseInt(document.getElementById('number').innerHTML) > 0){
        window.localStorage.setItem(
          'Plus.htm-number',
          document.getElementById('number').innerHTML
        );
    }
}

window.onkeydown = function(e){
    if(!unlocked){
        return;
    }

    unlocked = false;
    plus();
};

window.onkeyup = function(e){
    unlocked = true;
};
{'fraction_non_alphanumeric': 0.1569362613818961, 'fraction_numerical': 0.004284949116229245, 'mean_word_length': 3.3747072599531616, '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': '5670072', 'n_tokens_mistral': 552, 'n_tokens_neox': 539, 'n_words': 79}