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

real cancel for insertRef dialog #3240

Merged
merged 3 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/texstudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5739,14 +5739,18 @@ void Texstudio::insertRef(const QString &refCmd)
foreach (const LatexDocument *doc, docs)
labels << doc->labelItems();
} else return;
QString listItemUseNoLabel = "<" + tr("empty") + ">"; // of course we can't insert in the document a ref to this label
labels.sort();
labels.prepend(listItemUseNoLabel);
UniversalInputDialog dialog;
dialog.addVariable(&labels, tr("Labels:"));
if (dialog.exec() && !labels.isEmpty()) {
QString tag = refCmd + "{" + labels.first() + "}";
if (dialog.exec()) {
QString cmdArgument = labels.first();
if (cmdArgument == listItemUseNoLabel)
cmdArgument = "";
QString tag = refCmd + "{" + cmdArgument + "}";
insertTag(tag, tag.length(), 0);
} else
insertTag(refCmd + "{}", refCmd.length() + 1, 0);
} // Cancel button inserts nothing
}

void Texstudio::insertRef()
Expand Down
3 changes: 1 addition & 2 deletions utilities/manual/source/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# CHANGELOG
TeXstudio 4.6.3

-

- Cancel button of dialog for inserting label references now inserts nothing, but you can still add an empty reference when needed ([#3230](https://github.com/texstudio-org/texstudio/issues/3230))

## TeXstudio 4.6.2

Expand Down