mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[escher] In ExpressionLayoutCursor, when inserting text, replace *_{*}
by *(*)
This commit is contained in:
@@ -172,6 +172,7 @@ void ExpressionLayoutCursor::insertText(const char * text) {
|
||||
}
|
||||
ExpressionLayout * newChild = nullptr;
|
||||
ExpressionLayout * pointedChild = nullptr;
|
||||
bool specialUnderScore = false;
|
||||
for (int i = 0; i < textLength; i++) {
|
||||
if (text[i] == Ion::Charset::Empty) {
|
||||
continue;
|
||||
@@ -185,8 +186,19 @@ void ExpressionLayoutCursor::insertText(const char * text) {
|
||||
}
|
||||
} else if (text[i] == ')') {
|
||||
newChild = new RightParenthesisLayout();
|
||||
} else if (text[i] == '_') {
|
||||
specialUnderScore = ((i < textLength) && (text[i+1] == '{')) ? true : false;
|
||||
if (!specialUnderScore) {
|
||||
newChild = new CharLayout('_');
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else if (text[i] == '{' && specialUnderScore) {
|
||||
newChild = new CharLayout('(');
|
||||
} else if (text[i] == '}' && specialUnderScore) {
|
||||
newChild = new CharLayout(')');
|
||||
specialUnderScore = false;
|
||||
}
|
||||
|
||||
/* We never insert text with brackets for now. Removing this code saves the
|
||||
* binary file 2K. */
|
||||
#if 0
|
||||
|
||||
Reference in New Issue
Block a user