Skip to content

keyval completion from empty string fails if on new line #3962

Open
@mbertucci47

Description

@mbertucci47

Environment

  • TeXstudio: 4.8.6
  • Qt: 6.8.1
  • OS: windows 11
  • TeX distribution: N/A

Expected behavior

For most commands that accept keyvals, it is valid TeX syntax to place the keyval entries on a new line after the command. For example, one might write the keyval entries for \tcbset of tcolorbox like

\tcbset{
  key1=value1,
  key2=value2,
}

or

\tcbset
  {
    key1=value1,
    key2=value2,
  }

With these or any other code formats, TXS should be able to autocomplete keyvals from an empty string.

Actual behavior

TXS can autocomplete keyval entries from the empty string, but this fails if the cursor is on line different from the command. For example, placing the cursor on the line after \tcbset and hitting Ctrl+Space does not bring up the autocompleter:

\tcbset{
  
  }

The completer has no problems completing a keyval that is already partially typed.

How to reproduce

Place your cursor before the comments and hit Ctrl+Space.

\documentclass{article}
\usepackage{tcolorbox}

\begin{document}

\tcbset{ % works with cursor on this line
    % does not work with cursor on this line
  }

\tcbset
  {  % does not work with cursor on this line
     % does not work with cursor on this line
  }
  
\end{document}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions