<commit_before>const _ = require('lodash'),
  filterableList = require('../filterable-list'),
  addComponent = require('../components/add-component'),
  pane = require('./');

/**
 * open the add component pane
 * @param {array} components
 * @param {object} options to call addComponent with
 * @returns {Element}
 */
function openAddComponent(components, options) {
  var header = 'Add Component',
    innerEl = filterableList.create(components, {
      click: function (id) {
        return addComponent(options.pane, options.field, id, options.ref)
          .then(() => close()); // only close pane if we added successfully<commit_msg>Calling pane.close instead of close() which might close a tab (#607)<commit_after>const _ = require('lodash'),
  filterableList = require('../filterable-list'),
  addComponent = require('../components/add-component'),
  pane = require('./');

/**
 * open the add component pane
 * @param {array} components
 * @param {object} options to call addComponent with
 * @returns {Element}
 */
function openAddComponent(components, options) {
  var header = 'Add Component',
    innerEl = filterableList.create(components, {
      click: function (id) {
        return addComponent(options.pane, options.field, id, options.ref)
          .then(() => pane.close()); // only close pane if we added successfully
{'fraction_non_alphanumeric': 0.14402985074626865, 'fraction_numerical': 0.002238805970149254, 'mean_word_length': 3.912087912087912, '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': '2244352', 'n_tokens_mistral': 374, 'n_tokens_neox': 361, 'n_words': 111}