<commit_before>(function (Handsontable) {
  var AsuggestEditor = Handsontable.editors.HandsontableEditor.prototype.extend();

  AsuggestEditor.prototype.beginEditing = function () {
    Handsontable.editors.HandsontableEditor.prototype.beginEditing.apply(this, arguments);
    var that = this;

    var options = this.cellProperties.options;

    if (typeof this.cellProperties.source == 'function'){
      this.cellProperties.source(query, function(choices){
        this.$textarea.asuggest(choices, options);
      });

    } else if (Handsontable.helper.isArray(this.cellProperties.source)) {
      var choices;
      choices = this.cellProperties.source;
      this.$textarea.asuggest(choices, options);<commit_msg>fixes #2 - check if cell is already initialized<commit_after>(function (Handsontable) {
  var AsuggestEditor = Handsontable.editors.HandsontableEditor.prototype.extend();

  AsuggestEditor.prototype.beginEditing = function () {
    if (this.state != Handsontable.EditorState.VIRGIN) {
      return;
    }    
    Handsontable.editors.HandsontableEditor.prototype.beginEditing.apply(this, arguments);
    var that = this;

    var options = this.cellProperties.options;

    if (typeof this.cellProperties.source == 'function'){
      this.cellProperties.source(query, function(choices){
        this.$textarea.asuggest(choices, options);
      });

    } else if (Handsontable.helper.isArray(this.cellProperties.source)) {
      var choices;
      choices = this.cellProperties.source;
      this.$textarea.asuggest(choices, options);
{'fraction_non_alphanumeric': 0.1159047005795235, 'fraction_numerical': 0.000643915003219575, 'mean_word_length': 4.012903225806451, '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': '5276747', 'n_tokens_mistral': 462, 'n_tokens_neox': 450, 'n_words': 74}