﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4065	Linebreaks, comments in component argument list are mangled after moving it	Christoph <buchner@…>	Martin Sjölund	"I often align the arguments in a component instantiation with linebreaks (a must if you have many arguments, to avoid running endless lines). Sometimes I add in-line comments to some arguments, or even comment out arguments when testing/changing models.

This can look like this (simple minimum example, see component `boundary`, but imagine 5+ arguments):

{{{
model test_linebreaks
  Modelica.Fluid.Sources.FixedBoundary boundary(use_p = false, //some comment
                                                use_T = false) annotation(Placement(visible = true, transformation(origin = {-54, 42}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Sources.Boundary_pT boundary1 annotation(Placement(visible = true, transformation(origin = {-30, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(boundary.ports[1], boundary1.ports[1]) annotation(Line(points = {{-44, 42}, {-44, 9}, {-20, 9}, {-20, -30}}, color = {0, 127, 255}));
  annotation(uses(Modelica(version = ""3.2.2"")), Icon(graphics = {Polygon(origin = {-13.1502, 17.2813}, points = {{-20.8498, 26.7187}, {75.1502, 6.71867}, {15.1502, 54.7187}, {-74.8498, 22.7187}, {-42.8498, -55.2813}, {-20.8498, 26.7187}})}));
end test_linebreaks;
}}}

In current OMEdit, as soon as I move the component in the diagram, (or, it seems, change the position of a connection line attached to it), OMEdit somehow reorders the code, and removes all the linebreaks, and pulls comments out of the argument list, like this:

{{{
model test_linebreaks
  Modelica.Fluid.Sources.FixedBoundary boundary(use_p = false, use_T = false) annotation(Placement(visible = true, transformation(origin = {-54, 42}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  //some comment
  Modelica.Fluid.Sources.Boundary_pT boundary1 annotation(Placement(visible = true, transformation(origin = {-30, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(boundary.ports[1], boundary1.ports[1]) annotation(Line(points = {{-44, 42}, {-44, 19}, {-20, 19}, {-20, -30}}, color = {0, 127, 255}));
  annotation(uses(Modelica(version = ""3.2.2"")), Icon(graphics = {Polygon(origin = {-13.1502, 17.2813}, points = {{-20.8498, 26.7187}, {75.1502, 6.71867}, {15.1502, 54.7187}, {-74.8498, 22.7187}, {-42.8498, -55.2813}, {-20.8498, 26.7187}})}));
end test_linebreaks;
}}}

This is not helpful, and on the contrary very frustrating. One has to often either undo the changes with Git (as OMEdit Ctrl-Z/Undo does not even pick up the change), which crashes OMedit if you don't unload the package first, or redo the changes (not fun for 5+ arguments).

Can this behaviour be fixed or circumvented?
"	defect	closed	high	1.9.x	Interactive Environment		fixed		
