You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever the position of the editor's caret changes (e.g. when editing a CellML file), we extract the statement that corresponds to an equation, so we can render it. However, there are cases where we might be editing a comment that is just before an equation, and which will return the wrong statement (because of the way the comment is being edited):
There are also cases where things will go wrong if we have certain Unicode characters. For example, say that we have the following CellML file:
def model my_model as
def unit ms as
unit second {pref: milli};
enddef;
// フランス人
def unit mV as
unit volt {pref: milli};
enddef;
def unit mV_per_ms as
unit mV {expo: 1};
unit ms {expo: -1};
enddef;
def comp main as
var time: ms;
var v: mV {init: 1};
// dv/dt = 1
// v(0) = 1
ode(v, time) = 1{mV_per_ms};
enddef;
enddef;
フランス人 will render our update viewer completely wrong (because of those characters taking 3 bytes rather than 1). Then, we also have to be careful about some Unicode characters being used in our partial statement. For example, if we were to copy/paste フランス人 in the dv/dt comment, then this would mess up or check in CellmlTextViewWidget::statement().
The text was updated successfully, but these errors were encountered:
agarny
changed the title
CellML Text view: the wrong statement may be retrieved when editing a comment
CellML Text view: the viewer doesn't get updated properly in some cases
Dec 20, 2018
agarny
added a commit
to agarny/opencor
that referenced
this issue
Dec 20, 2018
agarny
changed the title
CellML Text view: the viewer doesn't get updated properly in some cases
CellML Text view: improve Unicode support
Dec 20, 2018
agarny
added a commit
to agarny/opencor
that referenced
this issue
Dec 21, 2018
Whenever the position of the editor's caret changes (e.g. when editing a CellML file), we extract the statement that corresponds to an equation, so we can render it. However, there are cases where we might be editing a comment that is just before an equation, and which will return the wrong statement (because of the way the comment is being edited):
There are also cases where things will go wrong if we have certain Unicode characters. For example, say that we have the following CellML file:
フランス人
will render our update viewer completely wrong (because of those characters taking 3 bytes rather than 1). Then, we also have to be careful about some Unicode characters being used in our partial statement. For example, if we were to copy/pasteフランス人
in the dv/dt comment, then this would mess up or check inCellmlTextViewWidget::statement()
.The text was updated successfully, but these errors were encountered: