<commit_before>
/**
 * @memberOf maptalks.TextMarker
 * @name TextMarker.Edit
 */
Z.TextMarker.Editor = {
    /**
     * Start to edit the text, editing will be ended automatically whenever map is clicked.
     *
     * @return {maptalks.TextMarker} this
     * @fires maptalks.TextMarker#edittextstart
     */
    startEditText: function () {
        if (!this.getMap()) {
            return this;
        }
        this.hide();
        this.endEditText();
        this._prepareEditor();
        /**
         * edittextstart when starting to edit text content
         * @event maptalks.TextMarker#edittextstart
         * @type {Object}
         * @property {String} type - edittextstart
         * @property {maptalks.TextMarker} target - fires the event
         */
        this._fireEvent('edittextstart');
        return this;
    },

    /**
     * End text edit.
     *
     * @return {maptalks.TextMarker} this
     * @fires maptalks.TextMarker#edittextend
     */
    endEditText: function () {
        if (this._textEditor) {
            var content = this._textEditor.innerText;
            content = this._filterContent(content);
            this.setContent(content);
            this.show();
            Z.DomUtil.off(this._textEditor, 'mousedown dblclick', Z.DomUtil.stopPropagation);
            this.getMap().off('mousedown', this.endEditText, this);
            this._editUIMarker.remove();
            delete this._editUIMarker;
            delete this._textEditor.onkeyup;
            delete this._textEditor;
            /**
             * edittextend when ended editing text content
             * @event maptalks.TextMarker#edittextend
             * @type {Object}
             * @property {String} type - edittextend
             * @property {maptalks.TextMarker} target - textMarker fires the event
             */
            this._fireEvent('edittextend');
        }<commit_msg>fix some bug.<commit_after>
/**
 * @memberOf maptalks.TextMarker
 * @name TextMarker.Edit
 */
Z.TextMarker.Editor = {
    /**
     * Start to edit the text, editing will be ended automatically whenever map is clicked.
     *
     * @return {maptalks.TextMarker} this
     * @fires maptalks.TextMarker#edittextstart
     */
    startEditText: function () {
        if (!this.getMap()) {
            return this;
        }
        this.hide();
        this.endEditText();
        this._prepareEditor();
        /**
         * edittextstart when starting to edit text content
         * @event maptalks.TextMarker#edittextstart
         * @type {Object}
         * @property {String} type - edittextstart
         * @property {maptalks.TextMarker} target - fires the event
         */
        this._fireEvent('edittextstart');
        return this;
    },

    /**
     * End text edit.
     *
     * @return {maptalks.TextMarker} this
     * @fires maptalks.TextMarker#edittextend
     */
    endEditText: function () {
        if (this._textEditor) {
            var content = this._textEditor.innerText;
            content = this._filterContent(content);
            this.setContent(content);
            this.show();
            Z.DomUtil.off(this._textEditor, 'mousedown dblclick', Z.DomUtil.stopPropagation);
            this.getMap().off('mousedown', this.endEditText, this);
            this._editUIMarker.remove();
            delete this._editUIMarker;
            this._textEditor.onkeyup = null;
            delete this._textEditor;
            /**
             * edittextend when ended editing text content
             * @event maptalks.TextMarker#edittextend
             * @type {Object}
             * @property {String} type - edittextend
             * @property {maptalks.TextMarker} target - textMarker fires the event
             */
            this._fireEvent('edittextend');
        }
{'fraction_non_alphanumeric': 0.1080797481636936, 'fraction_numerical': 0.0, 'mean_word_length': 1.8996197718631178, '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': '2352186', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1060, 'n_words': 228}