public static int nextTabStop(int x, @NotNull Editor editor, int tabSize) {
    int leftInset = ReadAction.compute(() -> editor.getContentComponent().getInsets().left);
    return nextTabStop(x - leftInset, getSpaceWidth(Font.PLAIN, editor), tabSize) + leftInset;
  }
public static int nextTabStop(int x, @NotNull Editor editor, int tabSize)