void () { @SuppressWarnings("SpellCheckingInspection") /* * caret * (initial pos) * v * (0th) |Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. * ^ * Actions from here: * 1. Caret left x 2 (no notifications are expected) * 2. Caret up x 2 (no notifications are expected) * 3. Caret right x 5 * 4. Caret down x 2 * * (1st) Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. * * caret * (after step 4) * v * (2nd) Lorem| ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. * ^ * Actions from here: * 5. Caret up x 1 * 6. Caret right x 6 * 7. Caret down x 3 * * (3rd) Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. * * caret caret * (after step 7) (after step 11) * v v * (4th) Lorem ipsum| dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.| * ^ ^ * Actions from here: Actions from here: * 8. Caret up x 1 12. Caret right x 2 (no notifications are expected) * 9. Caret down x 1 13. Caret down x 2 (no notifications are expected) * 10. Caret left x 6 * 11. Move caret to the end of the line */ final EditorImpl editor = initEditor(StringUtil.repeat(LOREM_IPSUM + '\n', 4) + LOREM_IPSUM, 0, 0, 0); //noinspection DuplicateExpressions doTestCaretNotifications( editor.getContentComponent(), // step 1 new CaretAction(() -> left(), null), new CaretAction(() -> left(), null), // step 2 new CaretAction(() -> up(), null), new CaretAction(() -> up(), null), // step 3 new CaretAction(() -> right(), new CaretPos(1, 1)), new CaretAction(() -> right(), new CaretPos(2, 2)), new CaretAction(() -> right(), new CaretPos(3, 3)), new CaretAction(() -> right(), new CaretPos(4, 4)), new CaretAction(() -> right(), new CaretPos(5, 5)), // step 4 new CaretAction(() -> down(), new CaretPos(5 + (LOREM_IPSUM.length() + 1), 5 + (LOREM_IPSUM.length() + 1))), new CaretAction(() -> down(), new CaretPos(5 + 2 * (LOREM_IPSUM.length() + 1), 5 + 2 * (LOREM_IPSUM.length() + 1))), // step 5 new CaretAction(() -> up(), new CaretPos(5 + (LOREM_IPSUM.length() + 1), 5 + (LOREM_IPSUM.length() + 1))), // step 6 new CaretAction(() -> right(), new CaretPos(6 + (LOREM_IPSUM.length() + 1), 6 + (LOREM_IPSUM.length() + 1))), new CaretAction(() -> right(), new CaretPos(7 + (LOREM_IPSUM.length() + 1), 7 + (LOREM_IPSUM.length() + 1))), new CaretAction(() -> right(), new CaretPos(8 + (LOREM_IPSUM.length() + 1), 8 + (LOREM_IPSUM.length() + 1))), new CaretAction(() -> right(), new CaretPos(9 + (LOREM_IPSUM.length() + 1), 9 + (LOREM_IPSUM.length() + 1))), new CaretAction(() -> right(), new CaretPos(10 + (LOREM_IPSUM.length() + 1), 10 + (LOREM_IPSUM.length() + 1))), new CaretAction(() -> right(), new CaretPos(11 + (LOREM_IPSUM.length() + 1), 11 + (LOREM_IPSUM.length() + 1))), // step 7 new CaretAction(() -> down(), new CaretPos(11 + 2 * (LOREM_IPSUM.length() + 1), 11 + 2 * (LOREM_IPSUM.length() + 1))), new CaretAction(() -> down(), new CaretPos(11 + 3 * (LOREM_IPSUM.length() + 1), 11 + 3 * (LOREM_IPSUM.length() + 1))), new CaretAction(() -> down(), new CaretPos(11 + 4 * (LOREM_IPSUM.length() + 1), 11 + 4 * (LOREM_IPSUM.length() + 1))), // step 8 new CaretAction(() -> up(), new CaretPos(11 + 3 * (LOREM_IPSUM.length() + 1), 11 + 3 * (LOREM_IPSUM.length() + 1))), // step 9 new CaretAction(() -> down(), new CaretPos(11 + 4 * (LOREM_IPSUM.length() + 1), 11 + 4 * (LOREM_IPSUM.length() + 1))), // step 10 new CaretAction(() -> left(), new CaretPos(10 + 4 * (LOREM_IPSUM.length() + 1), 10 + 4 * (LOREM_IPSUM.length() + 1))), new CaretAction(() -> left(), new CaretPos(9 + 4 * (LOREM_IPSUM.length() + 1), 9 + 4 * (LOREM_IPSUM.length() + 1))), new CaretAction(() -> left(), new CaretPos(8 + 4 * (LOREM_IPSUM.length() + 1), 8 + 4 * (LOREM_IPSUM.length() + 1))), new CaretAction(() -> left(), new CaretPos(7 + 4 * (LOREM_IPSUM.length() + 1), 7 + 4 * (LOREM_IPSUM.length() + 1))), new CaretAction(() -> left(), new CaretPos(6 + 4 * (LOREM_IPSUM.length() + 1), 6 + 4 * (LOREM_IPSUM.length() + 1))), new CaretAction(() -> left(), new CaretPos(5 + 4 * (LOREM_IPSUM.length() + 1), 5 + 4 * (LOREM_IPSUM.length() + 1))), // step 11 new CaretAction(() -> end(), new CaretPos(LOREM_IPSUM.length() + 4 * (LOREM_IPSUM.length() + 1), LOREM_IPSUM.length() + 4 * (LOREM_IPSUM.length() + 1))), // step 12 new CaretAction(() -> right(), null), new CaretAction(() -> right(), null), // step 13 new CaretAction(() -> down(), null), new CaretAction(() -> down(), null) ); }