Skip to content

Commit

Permalink
Fixes #3698. Don't try to merge AST just replace it.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Feb 20, 2016
1 parent ab3521f commit c5333e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/Editors/ModelicaTextEditor.cpp
Expand Up @@ -154,7 +154,7 @@ QStringList ModelicaTextEditor::getClassNames(QString *errorString)
if (!modelicaText.startsWith("within")) {
stringToParse = QString("within %1;%2").arg(pLibraryTreeItem->parent()->getNameStructure()).arg(modelicaText);
}
classNames = pOMCProxy->parseString(stringToParse, pLibraryTreeItem->getNameStructure());
classNames = pOMCProxy->parseString(stringToParse, pLibraryTreeItem->getFileName());
}
// if user is defining multiple top level classes.
if (classNames.size() > 1) {
Expand Down
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/Modeling/ModelWidgetContainer.cpp
Expand Up @@ -2781,12 +2781,12 @@ bool ModelWidget::modelicaEditorTextChanged()
LibraryTreeItem *pParentLibraryTreeItem= mpModelWidgetContainer->getMainWindow()->getLibraryWidget()->getLibraryTreeModel()->getContainingFileParentLibraryTreeItem(mpLibraryTreeItem);
if (pParentLibraryTreeItem != mpLibraryTreeItem) {
stringToLoad = mpLibraryTreeItem->getClassTextBefore() + modelicaText + mpLibraryTreeItem->getClassTextAfter();
if (!pOMCProxy->loadString(stringToLoad, pParentLibraryTreeItem->getFileName(), Helper::utf8, true)) {
if (!pOMCProxy->loadString(stringToLoad, pParentLibraryTreeItem->getFileName(), Helper::utf8, false, true)) {
return false;
}
} else {
stringToLoad = modelicaText;
if (!pOMCProxy->loadString(stringToLoad, mpLibraryTreeItem->getFileName(), Helper::utf8, true)) {
if (!pOMCProxy->loadString(stringToLoad, mpLibraryTreeItem->getFileName(), Helper::utf8, false, true)) {
return false;
}
}
Expand Down

0 comments on commit c5333e1

Please sign in to comment.