Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

issue with keyval completion and open bracket #3159

Open
mbertucci47 opened this issue Jun 12, 2023 · 8 comments
Open

issue with keyval completion and open bracket #3159

mbertucci47 opened this issue Jun 12, 2023 · 8 comments

Comments

@mbertucci47
Copy link
Contributor

Environment

  • TeXstudio: 4.6.0alpha1
  • Qt: 6.5.0
  • OS: Windows 10
  • TeX distribution: N/A

Expected behavior

Once one selects a keyval with "Enter" or by clicking it, the completer should not pop back up with the keyval list.

Actual behavior

If the argument is not closed, the keyval list pops up. Consider

pic1

Once you select the keyval, the completion list should disappear because the user needs to fill the "val" of the "keyval". However after selecting the keyval it just pops back up:

pic2

The issue does not occur if the argument is closed, meaning starting with \begin{tikzcd}[fon]. The same behavior is observed regardless of the delimiter, e.g. \tikzcdset{fon shows the same issue.

This is relevant for users like me who don't have the completer turned on by default (so closing delimiters are not added automatically) but do often activate the keyval completion manually with Ctrl+Space.

How to reproduce

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}

\begin{tikzcd}[fon

\end{tikzcd}
\end{document}

Insert cursor after fon and follow steps above.

@sunderme
Copy link
Member

Have you disabled "placeholders", because here no pop-up.
Instead:

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}
	
	\begin{tikzcd}[font=|font commands
		
	\end{tikzcd}
\end{document}

| for cursor.

@mbertucci47
Copy link
Contributor Author

It seems the option you're talking about is "Insert arguments" which does fix it - there is also an "Arguments as placeholders" option; it seems to have no effect on this and I don't know what it does in general.

I'm not a fan of the placeholders but no worries if you don't think this is worth fixing for users with placeholders disabled.

@mbertucci47
Copy link
Contributor Author

mbertucci47 commented Jun 13, 2023

Actually from the documentation it would seem "Arguments as placeholders" should be the option which controls the placeholder feature. But I just double checked and it's "Insert arguments" that determines whether or not a placeholder is created. Is this intended behavior?

Edit: Sorry, I think I get the options now. One thing that still confuses me is "Arguments as placeholders" seems to have no effect without "Insert arguments". For example one might expect that using the former without the latter would mean \frac{}{} has empty placeholders in each arg that you can move between with Ctrl + -> etc., but this is not the case.

@sunderme
Copy link
Member

Probably you need some text for the placeholders for them to work.

@sunderme
Copy link
Member

I have fixed some problems around this issue, but the actual problem is the "unlosed" square bracket.
Usually when using the completer, brackets always appear in pairs and there is no issue.

@mbertucci47
Copy link
Contributor Author

Thanks! Right, I admit I'm a somewhat odd user in wanting keyval completion without using command completion much. I'll test the new build

@mbertucci47
Copy link
Contributor Author

As far as I can tell the behavior is the same as before, though perhaps that's what you meant by

the actual problem is the "unlosed" square bracket

@sunderme
Copy link
Member

yes, I can't fix the issue of the "unclosed" bracket easily, hence the remark.

@sunderme sunderme pinned this issue Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants