SimpleMDE called on initialization of elFinder cmd edit (this: this editor's config object)
433280
function(opts, fm) {
				if (fm.UA.ltIE10 || !fm.options.cdns.simplemde) {
					this.disabled = true;
				}
			}
968408
function aceInitialized(hook, context){
  var editorInfo = context.editorInfo;
  editorInfo.ace_doInsertHeading = _(doInsertHeading).bind(context);
}
89477
def init_editing_mode(self, e): # (M-C-j)
        ''''''
        self.show_all_if_ambiguous = 'on'
        self.key_dispatch = {}
        self.__vi_insert_mode = None
        self._vi_command = None
        self._vi_command_edit = None
        self._vi_key_find_char = None
        self._vi_key_find_direction = True
        self._vi_yank_buffer = None
        self._vi_multiplier1 = ''
        self._vi_multiplier2 = ''
        self._vi_undo_stack = []
        self._vi_undo_cursor = -1
        self._vi_current = None
        self._vi_search_text = ''
        self.vi_save_line ()
        self.vi_set_insert_mode (True)
        # make ' ' to ~ self insert
        for c in range(ord(' '), 127):
            self._bind_key('%s' % chr(c), self.vi_key)
        self._bind_key('BackSpace', self.vi_backspace)
        self._bind_key('Escape', self.vi_escape)
        self._bind_key('Return', self.vi_accept_line)

        self._bind_key('Left', self.backward_char)
        self._bind_key('Right', self.forward_char)
        self._bind_key('Home', self.beginning_of_line)
        self._bind_key('End', self.end_of_line)
        self._bind_key('Delete', self.delete_char)

        self._bind_key('Control-d', self.vi_eof)
        self._bind_key('Control-z', self.vi_eof)
        self._bind_key('Control-r', self.vi_redo)
        self._bind_key('Up', self.vi_arrow_up)
        self._bind_key('Control-p', self.vi_up)
        self._bind_key('Down', self.vi_arrow_down)
        self._bind_key('Control-n', self.vi_down)
        self._bind_key('Tab', self.vi_complete)
956461
public void init(CmsImagePreviewHandler handler) {

        m_handler = handler;
        m_propertiesTab = new CmsPropertiesTab(m_galleryMode, m_dialogHeight, m_dialogWidth, m_handler);
        m_tabbedPanel.add(m_propertiesTab, Messages.get().key(Messages.GUI_PREVIEW_TAB_PROPERTIES_0));
        if ((m_galleryMode == GalleryMode.editor) || (m_galleryMode == GalleryMode.widget)) {
            m_imageFormatTab = new CmsImageFormatsTab(m_galleryMode, m_dialogHeight, m_dialogWidth, handler, null);
            m_tabbedPanel.add(m_imageFormatTab, Messages.get().key(Messages.GUI_PREVIEW_TAB_IMAGEFORMAT_0));
        }
        if (getGalleryMode() == GalleryMode.editor) {
            m_imageEditorFormatsTab = new CmsImageEditorTab(m_galleryMode, m_dialogHeight, m_dialogWidth, handler);

            String hideFormatsParam = Window.Location.getParameter("hideformats");
            boolean hideFormats = "true".equals(hideFormatsParam);
            if (!hideFormats) {
                m_tabbedPanel.add(m_imageEditorFormatsTab, Messages.get().key(Messages.GUI_PREVIEW_TAB_IMAGEOPTIONS_0));
            }

            m_imageAdvancedTab = new CmsImageAdvancedTab(m_galleryMode, m_dialogHeight, m_dialogWidth, handler);
            if (!hideFormats) {
                m_tabbedPanel.add(m_imageAdvancedTab, Messages.get().key(Messages.GUI_PREVIEW_TAB_IMAGEADVANCED_0));
            }
        }
        m_tabbedPanel.addSelectionHandler(new SelectionHandler<Integer>() {

            public void onSelection(SelectionEvent<Integer> event) {

                Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                    @SuppressWarnings("synthetic-access")
                    public void execute() {

                        updateClassForTab(event.getSelectedItem().intValue());
                    }
                });

            }
        });
    }
1058532
public function init()
	{
		// Prevents the extension from registering scripts and publishing assets when ran from the command line.
		if (Yii::$app instanceof \yii\console\Application){
			return;
		}
		parent::init();
		Yii::setAlias('djfly/kindeditor', dirname(dirname(__DIR__)) . '/djfly/kindeditor');
	}
1162796
function startCmdEditor (config, is_skip_header) {

	if (!is_skip_header) {
		console.log(colors.bold('--------------- Command Editor ---------------'));
	}

	// Show a prompt for choose the mode
	var promise = inquirer.prompt([{
		type: 'list',
		name: 'mode',
		message: 'What you want to do ?',
		choices: [
			'Show commands list', 'Add new command', 'Edit command', 'Delete command'
		]
	}]);

	promise.then(function (answer) {

		var mode = answer.mode;
		var promise = null;

		if (mode == 'Add new command') {
			promise = addCommandOnCmdEditor(config);
		} else if (mode == 'Edit command') {
			promise = editCommandOnCmdEditor(config);
		} else if (mode == 'Delete command') {
			promise = deleteCommandOnCmdEditor(config);
		} else if (mode == 'Show commands list') {
			promise = showCommandsOnCmdEditor(config);
		}

		if (!promise) {
			startCmdEditor(config, true);
			return;
		}

		promise.then(function () {
			startCmdEditor(config, true);
		});

	});

}
1142545
function Editor(el, model) {
  EditorInterface.call(this);
  this.el_ = el;

  _.assign(this.el_.style, constants.editorStyle, {
    padding: '0',
    overflowY: 'hidden'
  });

  this.ta_ = document.createElement('textarea');
  _.assign(this.ta_.style, constants.baseStyle, {
    display: 'block',
    margin: '0',
    border: '0',
    padding: constants.editorStyle.padding,
    width: '100%',
    height: '100%',
    font: constants.editorStyle.font,
    lineHeight: '1.2',
    outline: 'none',
    resize: 'none'
  });
  this.el_.appendChild(this.ta_);

  // Register input handlers. Use 'input' event to catch text mutations, and
  // various other events to catch selection mutations.
  this.ta_.addEventListener('input', this.handleInput_.bind(this));

  var handler = this.updateSelection_.bind(this);
  this.ta_.addEventListener('input', handler);
  this.ta_.addEventListener('keydown', handler);
  this.ta_.addEventListener('mousedown', handler);
  this.ta_.addEventListener('mousemove', handler);
  this.ta_.addEventListener('select', handler);
  window.addEventListener('blur', this.blur.bind(this));

  this.reset(model);
}
1075125
@Override
    public ConsoleEditor create(String flavor, Terminal terminal, InputStream in, PrintStream out) throws EditorInitializationException {
        if (flavorMap.containsKey(flavor)) {
            Class<? extends ConsoleEditor> editorClass = flavorMap.get(flavor);
            try {
                return instantiate(editorClass, terminal, in, out);
            } catch (Exception e) {
                throw new EditorInitializationException("Failed to create Editor instance of class:" + editorClass.getName(), e);
            }
        } else {
            Class<? extends ConsoleEditor> editorClass = resolve(flavor);
            if (editorClass != null) {
                flavorMap.put(flavor, editorClass);
                return create(flavor, terminal);
            } else {
                throw new EditorInitializationException("Unknown flavor:" + flavor);
            }
        }
    }
686593
def vieditable_init_listbox
      $log.debug " inside vieditable_init_listbox "
      @editable = true
      bind_key( ?C, :edit_line)
      bind_key( ?o) { insert_line(@current_index+1) } 
      bind_key( ?O) { insert_line(@current_index) } 
      bind_key( [?d, ?d] , :delete_line ) 
      bind_key( ?\C-_ ) { @undo_handler.undo if @undo_handler }
      bind_key( ?u ) { @undo_handler.undo if @undo_handler }
      bind_key( ?\C-r ) { @undo_handler.redo if @undo_handler }
      bind_key( [?y, ?y] , :kill_ring_save ) 
      bind_key( ?p, :yank ) # paste after this line
      #bind_key( ?P ) { yank(@current_index - 1) } # should be before this line
      # seems -1 was pasting 2 lines before
      bind_key( ?P ) { yank(@current_index - 0) } # should be before this line
      bind_key(?w, :forward_word)
      bind_key(?\M-y, :yank_pop)
      bind_key(?\C-y, :yank)
      bind_key(?\M-w, :kill_ring_save)
      @_events.push :CHANGE # thru vieditable
      #bind_key( ?D, :delete_eol)
      #bind_key( [?d, ?$], :delete_eol)
      #bind_key(?f, :forward_char)
      #bind_key( ?x, :delete_curr_char )
      #bind_key( ?X, :delete_prev_char )
      #bind_key( [?d, ?w], :delete_word )
      #bind_key( [?d, ?t], :delete_till )
      #bind_key( [?d, ?f], :delete_forward )

    end
986149
function activateEditing( editor )
	{
		var win = editor.window,
			doc = editor.document,
			body = editor.document.getBody(),
			bodyFirstChild = body.getFirst(),
			bodyChildsNum = body.getChildren().count();

		if ( !bodyChildsNum
			|| bodyChildsNum == 1
				&& bodyFirstChild.type == CKEDITOR.NODE_ELEMENT
				&& bodyFirstChild.hasAttribute( '_moz_editor_bogus_node' ) )
		{
			restoreDirty( editor );

			// Memorize scroll position to restore it later (#4472).
			var hostDocument = editor.element.getDocument();
			var hostDocumentElement = hostDocument.getDocumentElement();
			var scrollTop = hostDocumentElement.$.scrollTop;
			var scrollLeft = hostDocumentElement.$.scrollLeft;

			// Simulating keyboard character input by dispatching a keydown of white-space text.
			var keyEventSimulate = doc.$.createEvent( "KeyEvents" );
			keyEventSimulate.initKeyEvent( 'keypress', true, true, win.$, false,
				false, false, false, 0, 32 );
			doc.$.dispatchEvent( keyEventSimulate );

			if ( scrollTop != hostDocumentElement.$.scrollTop || scrollLeft != hostDocumentElement.$.scrollLeft )
				hostDocument.getWindow().$.scrollTo( scrollLeft, scrollTop );

			// Restore the original document status by placing the cursor before a bogus br created (#5021).
			bodyChildsNum && body.getFirst().remove();
			doc.getBody().appendBogus();
			var nativeRange = new CKEDITOR.dom.range( doc );
			nativeRange.setStartAt( body , CKEDITOR.POSITION_AFTER_START );
			nativeRange.select();
		}
	}
75885
function (ui, opts) {
    
		log("xxmlmirror.init");

		var $el = $(ui);
		var state = ($("div.xmlmirrorstate:first", $el).html() || "").trim();
		opts = $.extend({ defaultScript: state }, opts);

		$el.html(template.trim());

		var editor = null;
		(function iframeImplementation() {
			var iframe = $("iframe", ui);

			editor = ns.widgets.xmleditorInitIframe(iframe);

		})();

		if (opts.defaultScript) {
			editor.set(ns.modules.string.htmlDecode(opts.defaultScript));
		}

		var me = {};
		me.refresh = function () { editor.refresh(); };
		me.getXml = function () {
			var code = editor.get();
			return code;
		};
		me.setXml = function (xml) {
			editor.set(xml);
		};

		return me;
	}
312876
def initialize(self):
        """"""
        # TODO: This seems wrong, the user setting value is never used anywhere.
        if 'EnErrorStyle' not in self._vim.vars:
            self._vim.vars['EnErrorStyle'] = 'EnError'
        self._vim.command('highlight EnErrorStyle ctermbg=red gui=underline')

        # TODO: this SHOULD be a buffer-local setting only, and since it should
        # apply to all Scala files, ftplugin is the ideal place to set it. I'm
        # not even sure how this is currently working when only set once.
        self._vim.command('set omnifunc=EnCompleteFunc')

        # TODO: custom filetype ftplugin
        self._vim.command(
            'autocmd FileType package_info nnoremap <buffer> <Space> :call EnPackageDecl()<CR>')
        self._vim.command('autocmd FileType package_info setlocal splitright')
1050659
def initialize_ui(self):
        

        LOGGER.debug("> Initializing '{0}' Component ui.".format(self.__class__.__name__))

        self.__model = ProjectsModel(self, default_project=self.__default_project)

        self.Script_Editor_tabWidget = ScriptEditor_QTabWidget(self.__engine)
        self.Script_Editor_tabWidget_frame_gridLayout.addWidget(self.Script_Editor_tabWidget, 0, 0)
        self.__Script_Editor_tabWidget_set_ui()

        self.__recent_files_actions = []
        for i in range(self.__maximum_recent_files):
            self.__recent_files_actions.append(QAction(self.__menu_bar,
                                                       visible=False,
                                                       triggered=self.__load_recent_file__triggered))

        self.__menu_bar = QMenuBar()
        self.__menu_bar.setNativeMenuBar(False)
        self.Menu_Bar_frame_gridLayout.addWidget(self.__menu_bar)
        # Qt 4.8.4: Needs to show the menu_bar, otherwise it doesn't appear.
        self.__menu_bar.show()
        self.__initialize_menu_bar()

        self.Script_Editor_Output_plainTextEdit.setParent(None)
        self.Script_Editor_Output_plainTextEdit = Basic_QPlainTextEdit(self)
        self.Script_Editor_Output_plainTextEdit_frame_gridLayout.addWidget(
            self.Script_Editor_Output_plainTextEdit, 0, 0)
        self.Script_Editor_Output_plainTextEdit.setObjectName("Script_Editor_Output_plainTextEdit")
        self.__Script_Editor_Output_plainTextEdit_set_ui()

        self.__search_and_replace = SearchAndReplace(self, Qt.Window)
        self.__search_in_files = SearchInFiles(self, Qt.Window)

        self.__initialize_languages_model()

        self.Editor_Status_editorStatus = EditorStatus(self)
        self.__engine.statusBar.insertPermanentWidget(0, self.Editor_Status_editorStatus)

        Editor.get_untitled_file_name = self.__get_untitled_file_name

        # Signals / Slots.
        self.__engine.timer.timeout.connect(self.__Script_Editor_Output_plainTextEdit_refresh_ui)
        self.__engine.content_dropped.connect(self.__engine__content_dropped)
        self.__engine.layouts_manager.layout_restored.connect(self.__engine_layouts_manager__layout_restored)
        self.__engine.file_system_events_manager.file_changed.connect(
            self.__engine_file_system_events_manager__file_changed)
        self.__engine.file_system_events_manager.file_invalidated.connect(
            self.__engine_file_system_events_manager__file_invalidated)
        self.__engine.file_system_events_manager.directory_changed.connect(
            self.__engine_file_system_events_manager__directory_changed)
        self.__engine.file_system_events_manager.directory_invalidated.connect(
            self.__engine_file_system_events_manager__directory_invalidated)
        self.Script_Editor_tabWidget.tabCloseRequested.connect(self.__Script_Editor_tabWidget__tabCloseRequested)
        self.Script_Editor_tabWidget.currentChanged.connect(self.__Script_Editor_tabWidget__currentChanged)
        self.Script_Editor_tabWidget.content_dropped.connect(self.__Script_Editor_tabWidget__content_dropped)
        self.Script_Editor_tabWidget.tabBar().tabMoved.connect(self.__Script_Editor_tabWidget_tabBar__tabMoved)
        self.visibilityChanged.connect(self.__script_editor__visibilityChanged)
        self.ui_refresh.connect(self.__Script_Editor_Output_plainTextEdit_refresh_ui)
        self.recent_files_changed.connect(self.__set_recent_files_actions)
        self.__model.file_registered.connect(self.__model__file_registered)
        self.__model.file_unregistered.connect(self.__model__file_unregistered)
        self.__model.directory_registered.connect(self.__model__directory_registered)
        self.__model.directory_unregistered.connect(self.__model__directory_unregistered)
        self.__model.project_registered.connect(self.__model__project_registered)
        self.__model.project_unregistered.connect(self.__model__project_unregistered)
        self.__model.editor_registered.connect(self.__model__editor_registered)
        self.__model.editor_unregistered.connect(self.__model__editor_unregistered)

        self.initialized_ui = True
        return True
653266
def createEditor(self, parent, option, index):
        """"""
        if index.column() < 3:
            return None
        if self.show_warning(index):
            answer = QMessageBox.warning(self.parent(), _("Warning"),
                                      _("Opening this variable can be slow\n\n"
                                        "Do you want to continue anyway?"),
                                      QMessageBox.Yes | QMessageBox.No)
            if answer == QMessageBox.No:
                return None
        try:
            value = self.get_value(index)
            if value is None:
                return None
        except Exception as msg:
            QMessageBox.critical(self.parent(), _("Error"),
                                 _("Spyder was unable to retrieve the value of "
                                   "this variable from the console.<br><br>"
                                   "The error mesage was:<br>"
                                   "<i>%s</i>"
                                   ) % to_text_string(msg))
            return
        key = index.model().get_key(index)
        readonly = (isinstance(value, (tuple, set)) or self.parent().readonly
                    or not is_known_type(value))
        # CollectionsEditor for a list, tuple, dict, etc.
        if isinstance(value, (list, set, tuple, dict)):
            editor = CollectionsEditor(parent=parent)
            editor.setup(value, key, icon=self.parent().windowIcon(),
                         readonly=readonly)
            self.create_dialog(editor, dict(model=index.model(), editor=editor,
                                            key=key, readonly=readonly))
            return None
        # ArrayEditor for a Numpy array
        elif isinstance(value, (ndarray, MaskedArray)) \
          and ndarray is not FakeObject:
            editor = ArrayEditor(parent=parent)
            if not editor.setup_and_check(value, title=key, readonly=readonly):
                return
            self.create_dialog(editor, dict(model=index.model(), editor=editor,
                                            key=key, readonly=readonly))
            return None
        # ArrayEditor for an images
        elif isinstance(value, Image) and ndarray is not FakeObject \
          and Image is not FakeObject:
            arr = array(value)
            editor = ArrayEditor(parent=parent)
            if not editor.setup_and_check(arr, title=key, readonly=readonly):
                return
            conv_func = lambda arr: Image.fromarray(arr, mode=value.mode)
            self.create_dialog(editor, dict(model=index.model(), editor=editor,
                                            key=key, readonly=readonly,
                                            conv=conv_func))
            return None
        # DataFrameEditor for a pandas dataframe, series or index
        elif isinstance(value, (DataFrame, Index, Series)) \
          and DataFrame is not FakeObject:
            editor = DataFrameEditor(parent=parent)
            if not editor.setup_and_check(value, title=key):
                return
            editor.dataModel.set_format(index.model().dataframe_format)
            editor.sig_option_changed.connect(self.change_option)
            self.create_dialog(editor, dict(model=index.model(), editor=editor,
                                            key=key, readonly=readonly))
            return None
        # QDateEdit and QDateTimeEdit for a dates or datetime respectively
        elif isinstance(value, datetime.date):
            if readonly:
                return None
            else:
                if isinstance(value, datetime.datetime):
                    editor = QDateTimeEdit(value, parent=parent)
                else:
                    editor = QDateEdit(value, parent=parent)
                editor.setCalendarPopup(True)
                editor.setFont(get_font(font_size_delta=DEFAULT_SMALL_DELTA))
                return editor
        # TextEditor for a long string
        elif is_text_string(value) and len(value) > 40:
            te = TextEditor(None, parent=parent)
            if te.setup_and_check(value):
                editor = TextEditor(value, key,
                                    readonly=readonly, parent=parent)
                self.create_dialog(editor, dict(model=index.model(),
                                                editor=editor, key=key,
                                                readonly=readonly))
            return None
        # QLineEdit for an individual value (int, float, short string, etc)
        elif is_editable_type(value):
            if readonly:
                return None
            else:
                editor = QLineEdit(parent=parent)
                editor.setFont(get_font(font_size_delta=DEFAULT_SMALL_DELTA))
                editor.setAlignment(Qt.AlignLeft)
                # This is making Spyder crash because the QLineEdit that it's
                # been modified is removed and a new one is created after
                # evaluation. So the object on which this method is trying to
                # act doesn't exist anymore.
                # editor.returnPressed.connect(self.commitAndCloseEditor)
                return editor
        # CollectionsEditor for an arbitrary Python object
        else:
            editor = CollectionsEditor(parent=parent)
            editor.setup(value, key, icon=self.parent().windowIcon(),
                         readonly=readonly)
            self.create_dialog(editor, dict(model=index.model(), editor=editor,
                                            key=key, readonly=readonly))
            return None
796808
function onConfigLoaded( editor ) {
		var config = editor.config;

		/**
		 * Indicates the read-only state of this editor. This is a read-only property.
		 *
		 * @since 3.6
		 * @readonly
		 * @property {Boolean}
		 * @see CKEDITOR.editor#setReadOnly
		 */
		editor.readOnly = !!(
			config.readOnly || (
				editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ?
						editor.element.is( 'textarea' ) ?
								editor.element.hasAttribute( 'disabled' )
							:
								editor.element.isReadOnly()
					:
						editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ?
								editor.element.hasAttribute( 'disabled' )
							:
								false
			)
		);

		/**
		 * Indicates that the editor is running in an environment where
		 * no block elements are accepted inside the content.
		 *
		 * This can be for example inline editor based on `<h1>` element.
		 *
		 * @readonly
		 * @property {Boolean}
		 */
		editor.blockless = editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ?
			!( editor.element.is( 'textarea' ) || CKEDITOR.dtd[ editor.element.getName() ].p ) :
			false;

		/**
		 * The [tabbing navigation](http://en.wikipedia.org/wiki/Tabbing_navigation) order determined for this editor instance.
		 * This can be set by the <code>{@link CKEDITOR.config#tabIndex}</code>
		 * setting or taken from the `tabindex` attribute of the
		 * {@link #element} associated with the editor.
		 *
		 *		alert( editor.tabIndex ); // e.g. 0
		 *
		 * @readonly
		 * @property {Number} [=0]
		 */
		editor.tabIndex = config.tabIndex || editor.element && editor.element.getAttribute( 'tabindex' ) || 0;

		editor.activeEnterMode = editor.enterMode = validateEnterMode( editor, config.enterMode );
		editor.activeShiftEnterMode = editor.shiftEnterMode = validateEnterMode( editor, config.shiftEnterMode );

		// Set CKEDITOR.skinName. Note that it is not possible to have
		// different skins on the same page, so the last one to set it "wins".
		if ( config.skin )
			CKEDITOR.skinName = config.skin;

		// Fire the "configLoaded" event.
		editor.fireOnce( 'configLoaded' );

		initComponents( editor );
	}
501776
function initializeCommands() {
        var prefs = getPreferences();

        CommandManager.register(Strings.CMD_FILE_CLOSE_BELOW, closeBelow, function () {
            handleClose(closeBelow);
        });
        CommandManager.register(Strings.CMD_FILE_CLOSE_OTHERS, closeOthers, function () {
            handleClose(closeOthers);
        });
        CommandManager.register(Strings.CMD_FILE_CLOSE_ABOVE, closeAbove, function () {
            handleClose(closeAbove);
        });

        if (prefs.closeBelow) {
            workingSetListCmenu.addMenuItem(closeBelow, "", Menus.AFTER, Commands.FILE_CLOSE);
        }
        if (prefs.closeOthers) {
            workingSetListCmenu.addMenuItem(closeOthers, "", Menus.AFTER, Commands.FILE_CLOSE);
        }
        if (prefs.closeAbove) {
            workingSetListCmenu.addMenuItem(closeAbove, "", Menus.AFTER, Commands.FILE_CLOSE);
        }
        menuEntriesShown = prefs;
    }
1131753
def invoke_editor(before_editing, cluster_name):
    
    editor_cmd = os.environ.get('EDITOR')
    if not editor_cmd:
        raise PatroniCtlException('EDITOR environment variable is not set')

    with temporary_file(contents=before_editing.encode('utf-8'),
                        suffix='.yaml',
                        prefix='{0}-config-'.format(cluster_name)) as tmpfile:
        ret = subprocess.call([editor_cmd, tmpfile])
        if ret:
            raise PatroniCtlException("Editor exited with return code {0}".format(ret))

        with codecs.open(tmpfile, encoding='utf-8') as fd:
            after_editing = fd.read()

        return after_editing, yaml.safe_load(after_editing)