texstudio icon indicating copy to clipboard operation
texstudio copied to clipboard

keyvals with spaces in "val" part marked incorrect

Open mbertucci47 opened this issue 3 years ago • 2 comments

Environment

  • TeXstudio: 4.3.0alpha1
  • Qt: 6.3.0
  • OS: Windows 10
  • TeX distribution: miktex

Expected behavior

For keyvals with cwl listing of the form key=#val1,val2,..., the completer recognizes values with spaces, but when actually filled in they're marked as incorrect. For the cwl

# mypackage.cwl
\foo{keyvals}
#keyvals:\foo
key=#val,my val,anotherval,yet another val
#endkeyvals

the completer works fine:

iss1

Actual behavior

When filled in, the values with spaces are marked as incorrect:

iss2

Here's the listing for the last picture:

\documentclass{article}
\usepackage{mypackage}

\begin{document}
\foo{key=val}
\foo{key=my val}
\foo{key=anotherval}
\foo{key=yet another val}
\end{document}

I'll note this comes up in many places, e.g. the numbered key in thmtools:

iss3

mbertucci47 avatar Jun 03 '22 19:06 mbertucci47

what is the real scenario, where this plays a role ?

sunderme avatar Jun 04 '22 17:06 sunderme

Defining keyvals like this only seems to come up in tikz/pgfkeys packages, in which case the cwl listing usually has a #c anyways. I suppose this should be a FR or enhancement rather than a bug report.

mbertucci47 avatar Jun 04 '22 20:06 mbertucci47