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

Unexpected behavior of the Cancel button of the Ref window. #3230

Closed
hair-splitter opened this issue Jul 31, 2023 · 6 comments · Fixed by #3240
Closed

Unexpected behavior of the Cancel button of the Ref window. #3230

hair-splitter opened this issue Jul 31, 2023 · 6 comments · Fixed by #3240

Comments

@hair-splitter
Copy link

Environment

  • TeXstudio: 4.6.2
  • Qt: Qt 6.5.1
  • OS: Windows 10
  • TeX distribution: TeX Live 2023

Actual behavior

Do the following steps:

  1. File / New
  2. LaTeX / Cross References / ref
  3. Cancel

TXS inserts the following at the cursor:
\ref{}

Expected behavior

Nothing happens.

@sunderme
Copy link
Member

this is deliberate code.
I assume the author wanted to insert empty ref when desired, so this is a change request.

@octaeder
Copy link
Contributor

octaeder commented Aug 2, 2023

so a solution could be:

  • ok button inserts \ref with label
  • a new button inserts emtpy \ref
  • cancel button inserts nothing

@sunderme
Copy link
Member

sunderme commented Aug 2, 2023

@octaeder yes, or an extra entry in the drop-down list which inserts empty \ref{}

@octaeder
Copy link
Contributor

octaeder commented Aug 2, 2023

I thought that choosing an extra entry might be tricky. Obviously it should be the first entry then. And since it is a list of label names the entry should be empty. But at first it looks like you have no labels:

image

On the left dialog when no labels are present. No visual difference.

@sunderme
Copy link
Member

sunderme commented Aug 2, 2023

probably better to have something like <empty> or similar

@octaeder
Copy link
Contributor

octaeder commented Aug 2, 2023

PR #3240 is on the way. Same details as given in the PR:

Note: When the dialog is presented you can immediately (at least on windows)

  • scroll through the list with the up/down arrow keys
  • open the list with Alt+down arrow key (image to the right)
  • insert \ref{} by pressing Enter or clicking OK button

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants