texstudio
texstudio copied to clipboard
keyval completion fails if keys are last argument
Environment
- TeXstudio: 4.1.2
- Qt: 6.2.1
- OS: Windows 10
- TeX distribution: miktex
Expected behavior
From this discussion it's clear that TeXstudio doesn't allow for multiple keyval completion in the same command, but it also does not allow for completion when the keys are the last argument of a non-environment command.
Actual behavior
The following cwl results in the highlighting shown:
\foo{arg}[options%keyvals]
\goo{arg1}[options%keyvals]{arg2}
\begin{env}[options%keyvals]
\end{env}
#keyvals:\foo,\goo,\begin{env}
key
#endkeyvals
![bug](https://user-images.githubusercontent.com/61854785/145614739-dd196726-4099-4024-a78e-339297e9edbf.png)
The highlighting and completer work correctly for \goo
(keys not the last arg) and \begin{env}
(keys last arg but for an environment) but not for \foo
. The \foo{arg}
is essentially the same as \begin{env}
, so I thought it must be a bug.
there is special treatment for environments
Is this necessary somewhere ?
The \setmainfont{font}[font features%keyvals]
-type commands in fontspec and unicode-math are the main places I can think of. \pgfpagesuselayout{layout}[options%keyvals]
of pgfpages is another.