Skip to content

Commit acacec9

Browse files
authored
Do not add within twice (#10317)
Fixes #10312 The models save inside a package does already have within.
1 parent f91ef36 commit acacec9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

OMEdit/OMEditLIB/Modeling/ModelWidgetContainer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5542,7 +5542,7 @@ bool ModelWidget::isNewApi()
55425542
QString ModelWidget::getModelTextForOMCUndoCommand()
55435543
{
55445544
QString oldModelText = mpEditor->getPlainTextEdit()->toPlainText();
5545-
if (!mpLibraryTreeItem->isTopLevel()) {
5545+
if (!oldModelText.trimmed().startsWith("within") && !mpLibraryTreeItem->isTopLevel()) {
55465546
oldModelText = "within " % mpLibraryTreeItem->parent()->getNameStructure() % ";\n" % oldModelText;
55475547
}
55485548
return oldModelText;

0 commit comments

Comments
 (0)