int (@NotNull Editor editor, int line) { return ReadAction.compute(() -> { VisualPosition endLineVisualPosition = new VisualPosition(line, getLastVisualLineColumnNumber(editor, line)); return editor.visualPositionToOffset(endLineVisualPosition); }); }