<commit_before>import Ember from 'ember';
import layout from '../templates/components/at-js';
const { merge, observer } = Ember;

export default Ember.Component.extend({
  layout,
  settings: [{}],
  value: null,
  tagName: 'div',
  didInsertElement() {
    this.$().attr('contenteditable', 'true');
    this._setupTextarea();
    this.set('internalValue', this.get('value'));
  },
  keyUp(event) {
    this.set('value', this.$().html());
  },
  _settingsListener: observer('settings', function() { this._setupTextarea() }),
  _setupTextarea() {
    const defaults = {at: '@'};
    for(var i=0; i < this.get('settings').length; i++) {
      let settings = merge(defaults, this.get('settings')[i]);
      this.$().atwho(settings);
    }
  },
  destroy() {
    this.$().atwho('destroy');<commit_msg>don't set values in didInsertElement<commit_after>import Ember from 'ember';
import layout from '../templates/components/at-js';
const { merge, observer } = Ember;

export default Ember.Component.extend({
  layout,
  settings: [{}],
  value: null,
  tagName: 'div',
  init() {
    this._super(...arguments);
    this.set('internalValue', this.get('value'));
  },
  didInsertElement() {
    this.$().attr('contenteditable', 'true');
    this._setupTextarea();
  },
  keyUp(event) {
    this.set('value', this.$().html());
  },
  _settingsListener: observer('settings', function() { this._setupTextarea() }),
  _setupTextarea() {
    const defaults = {at: '@'};
    for(var i=0; i < this.get('settings').length; i++) {
      let settings = merge(defaults, this.get('settings')[i]);
      this.$().atwho(settings);
    }
  },
  destroy() {
    this.$().atwho('destroy');
{'fraction_non_alphanumeric': 0.20733173076923078, 'fraction_numerical': 0.001201923076923077, 'mean_word_length': 3.8542274052478134, 'pattern_counts': {'":': 0, '<': 5, '<?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': '630122', 'n_tokens_mistral': 538, 'n_tokens_neox': 538, 'n_words': 105}