Browse Source

字符串大于1024时禁用代码高亮

kunfei 4 years ago
parent
commit
5cbaa8874e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/src/main/java/io/legado/app/ui/widget/code/CodeView.kt

+ 1 - 1
app/src/main/java/io/legado/app/ui/widget/code/CodeView.kt

@@ -169,7 +169,7 @@ class CodeView : AppCompatMultiAutoCompleteTextView {
     }
     }
 
 
     private fun highlight(editable: Editable): Editable {
     private fun highlight(editable: Editable): Editable {
-        if (editable.isEmpty()) return editable
+        if (editable.isEmpty() || editable.length > 1024) return editable
         try {
         try {
             clearSpans(editable)
             clearSpans(editable)
             highlightErrorLines(editable)
             highlightErrorLines(editable)