fix(ui): regex cannot show in editor

This commit is contained in:
hyb1996
2018-10-06 11:42:13 +08:00
parent 54cbb78d8e
commit 4cae6496b0

View File

@@ -40,6 +40,12 @@ public class JavaScriptHighlighter implements SimpleTextWatcher.AfterTextChanged
}
public void addToken(int tokenStart, int tokenEnd, int color) {
if(mCount < tokenStart){
int c = mCount > 0 ? colors[mCount - 1] : color;
for (int i = mCount; i < tokenStart; i++) {
colors[i] = c;
}
}
for (int i = tokenStart; i < tokenEnd; i++) {
colors[i] = color;
}