CaretAndSelectionState (@NotNull Document document, final boolean processBlockSelection) { return WriteCommandAction.writeCommandAction(null).compute(() -> extractCaretAndSelectionMarkersImpl(document, processBlockSelection)); }