fixes for highlighting the expression and calculating factorial
This commit is contained in:
@@ -84,7 +84,9 @@ public class CalculatorEditor extends EditText {
|
||||
}
|
||||
|
||||
Log.d(this.getClass().getName(), getText().toString());
|
||||
setSelection(selectionStart, selectionEnd);
|
||||
|
||||
int length = getText().length();
|
||||
setSelection(Math.max(Math.min(length - 1, selectionStart), 0), Math.max(Math.min(length - 1, selectionEnd), 0));
|
||||
}
|
||||
|
||||
public boolean isHighlightText() {
|
||||
|
@@ -45,10 +45,6 @@ class ToJsclTextProcessor implements TextProcessor<PreparedExpression> {
|
||||
|
||||
if (mathTypeBefore == MathType.function && CollectionsUtils.find(MathType.openGroupSymbols, startsWithFinder) != null) {
|
||||
throw new ParseException("Empty function: " + mathTypeResult.getMatch());
|
||||
} else if (mathTypeBefore == MathType.postfix_function && mathTypeResult.getMathType() == MathType.binary_operation) {
|
||||
if ( mathTypeResult.getMatch().equals("^") ) {
|
||||
throw new ParseException("Power operation after postfix function is currently unsupported!");
|
||||
}
|
||||
}
|
||||
|
||||
i = mathTypeResult.processToJscl(result, i);
|
||||
|
Reference in New Issue
Block a user