void () { @Language("JAVA") @NonNls String text = """ public class Test { public void test() { int i = 1; int j = 1; } }"""; init(text, PlainTextFileType.INSTANCE); addBookmark(2); addBookmark(3); List<Bookmark> bookmarksBefore = getManager().getBookmarks(); assertEquals(2, bookmarksBefore.size()); getEditor().getCaretModel().setCaretsAndSelections( Collections.singletonList(new CaretState( getEditor().visualToLogicalPosition(new VisualPosition(2, getEditor().getDocument().getLineEndOffset(2) + 1)), null, null))); delete(); List<Bookmark> bookmarksAfter = getManager().getBookmarks(); assertEquals(1, bookmarksAfter.size()); for (Bookmark bookmark : bookmarksAfter) { checkBookmarkNavigation(bookmark); } init(text, PlainTextFileType.INSTANCE); getEditor().getCaretModel().setCaretsAndSelections( Collections.singletonList( new CaretState(getEditor().visualToLogicalPosition(new VisualPosition(2, getEditor().getDocument().getLineEndOffset(2))), null, null))); delete(); }