% !TEX program = xetex

\TeXXeTstate = 1

\indent
This is a left-to-right paragraph, interrupted
$$
x^2 + y^2 = z^2 \eqno(1)
$$
by a displayed equation.

\bigskip\hrule\bigskip

\noindent\beginR\indent
This is a right-to-left paragraph, interrupted
$$
x^2 + y^2 = z^2 \eqno(1)
$$
by a displayed equation.

\bigskip\hrule\bigskip

\indent
This is a left-to-right paragraph, interrupted
$$
\predisplaydirection = -1
x^2 + y^2 = z^2 \eqno(1)
$$
by a displayed equation that thinks the paragraph is right-to-left.

\bigskip\hrule\bigskip

\noindent\beginR\indent
And finally, a right-to-left paragraph, interrupted
$$
\predisplaydirection = 1
x^2 + y^2 = z^2 \eqno(1)
$$
by a displayed equation that thinks the paragraph is left-to-right.
(The reduced space above the equation looks like it may be a bug.)

\bye
