Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3630 closed defect (fixed)

OMEdit crashes or fumbles up the formatting when duplicating classes or copying and pasting text within the same package

Reported by: Francesco Casella Owned by: Adeel Asghar
Priority: blocker Milestone: 1.9.4
Component: OMEdit Version:
Keywords: Cc: andrea.bartolini@…

Description

Consider the attached .mo file, which contains a package A with a class M. Open the package with OMEdit.

Select M and duplicate it outside package A. Everything works nicely.

Create a new class N inside package A. Then, copy the second line from the code of class A.M and paste it within A.N. Then save A.N. The formatting is changed to some flavour of omc liking, and it will keep on changing to that forever, every time the model is saved.

Finally, duplicate model A.M inside package A as A.P. Then double click on A.P to open it. OMEdit crashes.

Attachments (1)

A.mo (56 bytes ) - added by Francesco Casella 9 years ago.
Test package

Download all attachments as: .zip

Change History (10)

by Francesco Casella, 9 years ago

Attachment: A.mo added

Test package

comment:1 by Francesco Casella, 9 years ago

Summary: OMEdit crashes or fumbles up when duplicating classe or copying and pasting text within the same packageOMEdit crashes or fumbles up the formatting when duplicating classes or copying and pasting text within the same package

comment:2 by Francesco Casella, 9 years ago

See also #3606, which reports the same situation on a different test case.

comment:3 by Francesco Casella, 9 years ago

The first problem was fixed in https://github.com/OpenModelica/OpenModelica/commit/b1e94adfd88825501d06c74aba48f412baf8d96b

As to the second, when A.M is duplicated inside the package as A.P, the new class also contains the statement within A; (which is weird), but is not saved when the save button is hit, nor does it appear in the package if selecting A.

Version 0, edited 9 years ago by Francesco Casella (next)

comment:4 by Martin Sjölund, 9 years ago

Status: newassigned

@Adeel: The problem here is that OMEdit calls diffModelicaFileListings on manual changes in the text layer. It must never do this as it prevents the user from making whitespace changes.

in reply to:  4 comment:5 by Adeel Asghar, 9 years ago

Replying to sjoelund.se:

@Adeel: The problem here is that OMEdit calls diffModelicaFileListings on manual changes in the text layer. It must never do this as it prevents the user from making whitespace changes.

Fixed in 104cbca/OMEdit.

comment:6 by Adeel Asghar, 9 years ago

The duplication issue depends on #3577. Once #3577 is fixed this should work automatically.

comment:7 by Francesco Casella, 9 years ago

Resolution: fixed
Status: assignedclosed

comment:8 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:9 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.