void () { String text = "testVar1 testVar2"; init(text, PlainTextFileType.INSTANCE); CaretModel caretModel = getEditor().getCaretModel(); caretModel.moveToOffset(0); Document document = getEditor().getDocument(); EditorSettings settings = getEditor().getSettings(); boolean camelModeToRestore = settings.isCamelWords(); settings.setCamelWords(false); try { executeAction("EditorNextWord"); assertEquals(text.indexOf(" "), caretModel.getOffset()); executeAction("EditorPreviousWordInDifferentHumpsMode"); assertEquals(text.indexOf("Var1"), caretModel.getOffset()); caretModel.moveToOffset(text.length()); executeAction("EditorPreviousWord"); assertEquals(text.indexOf("testVar2"), caretModel.getOffset()); executeAction("EditorNextWordInDifferentHumpsMode"); assertEquals(text.indexOf("Var2"), caretModel.getOffset()); caretModel.moveToOffset(text.length()); settings.setCamelWords(true); executeAction("EditorPreviousWordInDifferentHumpsMode"); assertEquals(text.indexOf("testVar2"), caretModel.getOffset()); executeAction("EditorNextWordInDifferentHumpsMode"); assertEquals(text.length(), caretModel.getOffset()); settings.setCamelWords(false); executeAction("EditorDeleteToWordStartInDifferentHumpsMode"); assertEquals("testVar1 test", document.getText()); caretModel.moveToOffset(0); executeAction("EditorDeleteToWordEndInDifferentHumpsMode"); assertEquals("Var1 test", document.getText()); } finally { settings.setCamelWords(camelModeToRestore); } }