Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

keyval completion starts from wrong letter if on new line #3966

Closed
mbertucci47 opened this issue Jan 29, 2025 · 17 comments
Closed

keyval completion starts from wrong letter if on new line #3966

mbertucci47 opened this issue Jan 29, 2025 · 17 comments

Comments

@mbertucci47
Copy link
Contributor

mbertucci47 commented Jan 29, 2025

Environment

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

Related: #3962

Expected behavior

When autocompleting keyvals, it should match the entire typed string.

Actual behavior

If the keyval is on a new line, it does not. It starts from the immediately preceding letter.

Here I've typed only the letter i, hit Ctrl+Space, and the completion list is as expected.

Image

But after typing in and hitting Ctrl+Space, the completion list matches keyvals starting with n, not in as expected.

Image

The expected behavior does occur if the keyval is on the same line as the command.

Image

How to reproduce

Place cursor after in and hit Ctrl+Space.

\documentclass{article}
\usepackage{tcolorbox}

\begin{document}

\tcbset{
  in
  }
  
\end{document}

I've confirmed the issue on both Windows 10 and 11 machines.

@sunderme
Copy link
Member

can't reproduce on linux

@mbertucci47
Copy link
Contributor Author

Could it be a line ending issue in the keyval completion code? I know windows and linux/mac do line endings differently

@sunderme
Copy link
Member

can't confirm on win11 (4.8.6rc1)

@mbertucci47
Copy link
Contributor Author

Hmm then it's probably related to my specific settings. This has been an annoyance for me for a long time so I'd really like to figure it out. Unfortunately changing my completion settings to the defaults shown in https://texstudio-org.github.io/configuration.html#configuring-the-autocompletion did not fix the issue.

@sunderme
Copy link
Member

I checked with completion (all) instead of completion (typical), but no difference

@mbertucci47
Copy link
Contributor Author

Same. I've tried changing a bunch of settings but nothing seems to fix it. Not sure where to go from here. If nothing can be done, I guess the issue can be closed.

@octaeder
Copy link
Contributor

octaeder commented Jan 29, 2025

I can confirm Win10:

Image

TeXstudio 4.8.6 (git 4.8.6beta1-4-gc4efbe39e)
Using Qt Version 6.8.1, compiled with Qt 6.8.1 R

I assume the package not being installed.

@mbertucci47
Copy link
Contributor Author

@octaeder Thanks for confirming.

I assume the package not being installed.

What do you mean by this?

@mbertucci47
Copy link
Contributor Author

Ah and sorry, I forgot this is a Windows 10 computer I'm on. I will change the issue description.

@octaeder
Copy link
Contributor

octaeder commented Jan 29, 2025

I thought I never used the package so it should not be installed by MikTeX. But it says I installed it last November. I think there was another issue with this package and it seems that I made a build of the pdf. Anyway, I wasn't sure if this might make a difference.

@octaeder
Copy link
Contributor

just to be complete, here the other case:

Image

@mbertucci47
Copy link
Contributor Author

I just tried on a Windows 11 machine and the issue is still there.

@octaeder
Copy link
Contributor

octaeder commented Jan 29, 2025

just something else. Type = and the completer closes:

Image

Example
\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[x]
content...
\end{tikzpicture}

\end{document}

@mbertucci47
Copy link
Contributor Author

@octaeder I think that needs a new issue. But interestingly it doesn't happen with keyvals that have more than one letter, e.g. typing = after xshift below does not close the completer.

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[xshift]
content...
\end{tikzpicture}

\end{document}

@octaeder
Copy link
Contributor

octaeder commented Jan 29, 2025

indeed, but I just wanted to see if I can find your issue with tikz. And here is the case:

Image
and there are many options starting with in (inner sep, ...)

Example>
\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[thick]
    \draw[
        in
        ]
        
\end{tikzpicture}

\end{document}

@sunderme
Copy link
Member

space or tab is the point ...

@sunderme
Copy link
Member

side effect of 7ec5dd8

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants