<commit_before>(function (window, AutoComplete, ch) {
    'use strict';
    /**
     * Congfigure shortcuts to navigate and set values, or cancel the typed text
     * @memberof! ch.AutoComplete.prototype
     * @function
     * @private
     * @returns {autocomplete}
     */
    AutoComplete.prototype._configureShortcuts = function () {
        var that = this;

        // Shortcuts
        ch.shortcuts.add(ch.onkeybackspace, this.uid, function () {
            // hides and clear the list
            if (that._el.value.length <= 1) {
                that._$suggestionsList[0].innerHTML = '';
                that._popover.hide();
            }
        });

        ch.shortcuts.add(ch.onkeyenter, this.uid, function (event) {
            ch.util.prevent(event);
            that._setQuery();
        });

        ch.shortcuts.add(ch.onkeyesc, this.uid, function () {
            that.hide();
            that._el.value = that._originalQuery;
        });

        ch.shortcuts.add(ch.onkeyuparrow, this.uid, function () {
            var value;

            // change the selected value & stores the future HTMLInputElement value
            if (that._selected === null) {
                that._selected = that._suggestionsQuantity -1;<commit_msg>GH-971 prevent event when arrow up is press, it moves the cursor to the start of the input text<commit_after>(function (window, AutoComplete, ch) {
    'use strict';
    /**
     * Congfigure shortcuts to navigate and set values, or cancel the typed text
     * @memberof! ch.AutoComplete.prototype
     * @function
     * @private
     * @returns {autocomplete}
     */
    AutoComplete.prototype._configureShortcuts = function () {
        var that = this;

        // Shortcuts
        ch.shortcuts.add(ch.onkeybackspace, this.uid, function () {
            // hides and clear the list
            if (that._el.value.length <= 1) {
                that._$suggestionsList[0].innerHTML = '';
                that._popover.hide();
            }
        });

        ch.shortcuts.add(ch.onkeyenter, this.uid, function (event) {
            ch.util.prevent(event);
            that._setQuery();
        });

        ch.shortcuts.add(ch.onkeyesc, this.uid, function () {
            that.hide();
            that._el.value = that._originalQuery;
        });

        ch.shortcuts.add(ch.onkeyuparrow, this.uid, function (event) {
            ch.util.prevent(event);
            var value;

            // change the selected value & stores the future HTMLInputElement value
            if (that._selected === null) {
                that._selected = that._suggestionsQuantity -1;
{'fraction_non_alphanumeric': 0.11677443895017117, 'fraction_numerical': 0.003423354887790034, 'mean_word_length': 1.8618063112078347, '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': '1854072', 'n_tokens_mistral': 753, 'n_tokens_neox': 705, 'n_words': 169}