\item of environment
itemize delays the setting of its label by using
\everypar. The label is stored in a box, printed at the start of the paragraph to the left (
0pt) and the box is void afterwards.
\tikz. That stores the contents in a box first and afterwards the box is set. Very simplified:
The contents of
\lstinline. It calls
\leavevmode right at the beginning. This explains, why
\lstinline right after
\item works. Inside an
\leavevmode does not start a paragraph.
\lst@Init, an excerpt from its definition:
\ifhmode\ifinner \lst@boxtrue \fi\fi
$\if t\lst@boxpos \vtop
\else \if b\lst@boxpos \vbox
\else \vcenter \fi\fi
\noindent starts a paragraph inside a
At the begin of the paragraph
\everytoks is executed and the label is set. Afterwards the label box is void (by
\box, up to the group level of
\item). This explains the label inside the menu item.
Then the menu item that has been stored in a box is set as entry in the
itemize environment, correctly using
\leavevmode. But it is too late now, the label is
already set and is not repeated, the label box is void.
As egreg already said,
\menu (and the other similar macros) should call
right at the beginning. Anyway
\menu will print material that will start a paragraph.
Manually it can be redefined:
\lst@Init uses the hook
\lsthk@BoxUnsafe if a vertical box is used.
\everypar can be cleared there:
Both ways fix the issue: