void () { if (ourEditors != null) return; ourEditors = new WeakHashMap<>(); ourEditorSearchActions = ActionsLoader.getActionGroup("EditorSearch"); if (ourEditorSearchActions == null) { Logger.getInstance(CtxEditors.class).debug("null action group for editor-search"); return; } EditorFactory.getInstance().addEditorFactoryListener(new EditorFactoryListener() { @Override public void editorReleased(@NotNull EditorFactoryEvent event) { final WeakReference<Component> cmpRef = ourEditors.remove(event.getEditor()); final Component cmp = cmpRef != null ? cmpRef.get() : null; if (cmp != null) { TouchBarsManager.unregister(cmp); } } }, ApplicationManager.getApplication()); ourCustomizer = new Customizer(new TBPanel.CrossEscInfo(false, false)/*always replace esc for editor search*/, null); }