I'm curious if it is possible to make a text object aware of its operator. In particular, I am writing a text object for LaTeX environments, where I want different behaviour depending on the operator. For instance, consider the following LaTeX snippet:
\begin{example}
Hello world
\end{example}
Here it is most convenient of die
deletes the content in a linewise fashion, whereas cie
deletes "Hello world", but preserves the indentation, i.e., gives
\begin{example}
|
\end{example}
where |
is the cursor.