void (final boolean honorCamelWordsSettings) { ThreadingAssertions.assertEventDispatchThread(); myCaretModel.doWithCaretMerging(() -> { removeSelection(); final EditorSettings settings = myEditor.getSettings(); boolean camelTemp = settings.isCamelWords(); final boolean needOverrideSetting = camelTemp && !honorCamelWordsSettings; if (needOverrideSetting) { settings.setCamelWords(false); } try { EditorActionHandler handler = EditorActionManager.getInstance().getActionHandler(IdeActions.ACTION_EDITOR_SELECT_WORD_AT_CARET); DataContext context = AnActionEvent.getInjectedDataContext(CaretSpecificDataContext.create(myEditor.getDataContext(), this)); Caret caret = context.getData(CommonDataKeys.CARET); assert caret != null; handler.execute(caret.getEditor(), caret, context); } finally { if (needOverrideSetting) { settings.resetCamelWords(); } } }); }