@@ -111,7 +111,7 @@ public class HighlightEditor extends CodeSuggestsEditText
111
111
private boolean [] isGoodLineArray ;
112
112
private int [] realLines ;
113
113
private int lineCount ;
114
- private boolean isFind = false ;
114
+ private boolean isFinding = false ;
115
115
/**
116
116
* Disconnect this undo/redo from the text
117
117
* view.
@@ -120,8 +120,7 @@ public class HighlightEditor extends CodeSuggestsEditText
120
120
/**
121
121
* The change listener.
122
122
*/
123
- private EditTextChangeListener
124
- mChangeListener ;
123
+ private EditTextChangeListener mChangeListener ;
125
124
private int numberWidth = 0 ;
126
125
private AutoFixError mAutoFixError ;
127
126
private Highlighter mHighlighter ;
@@ -508,7 +507,6 @@ public int getFirstLineIndex() {
508
507
*
509
508
* @return last lineInfo that is visible on the screen.
510
509
*/
511
- @ SuppressWarnings ("unused" )
512
510
public int getLastLineIndex () {
513
511
int height ;
514
512
if (verticalScroll != null ) {
@@ -767,7 +765,7 @@ public void pinLine(@Nullable LineInfo lineInfo) {
767
765
}
768
766
769
767
public void highlightText () {
770
- if (isFind ) return ;
768
+ if (isFinding ) return ;
771
769
772
770
disableTextChangedListener ();
773
771
highlight (getEditableText (), false );
@@ -806,26 +804,16 @@ private void clearSpans(Editable e, int start, int end) {
806
804
}
807
805
808
806
public Editable highlight (Editable editable , boolean newText ) {
809
- // editable.clearSpans();
810
807
if (editable .length () == 0 ) {
811
808
return editable ;
812
809
}
813
810
814
811
int editorHeight = getHeightVisible ();
815
-
816
812
int firstVisibleIndex ;
817
813
int lastVisibleIndex ;
818
814
if (!newText && editorHeight > 0 ) {
819
- if (verticalScroll != null && getLayout () != null ) {
820
- firstVisibleIndex = getLayout ().getLineStart (getFirstLineIndex ());
821
- } else {
822
- firstVisibleIndex = 0 ;
823
- }
824
- if (verticalScroll != null && getLayout () != null ) {
825
- lastVisibleIndex = getLayout ().getLineStart (getLastLineIndex ());
826
- } else {
827
- lastVisibleIndex = getText ().length ();
828
- }
815
+ firstVisibleIndex = getLayout ().getLineStart (getFirstLineIndex ());
816
+ lastVisibleIndex = getLayout ().getLineStart (getLastLineIndex ());
829
817
} else {
830
818
firstVisibleIndex = 0 ;
831
819
lastVisibleIndex = CHARS_TO_COLOR ;
@@ -893,7 +881,7 @@ public void onTextChanged(CharSequence s,
893
881
int count ) {
894
882
this .start = start ;
895
883
this .count = count ;
896
- isFind = false ;
884
+ isFinding = false ;
897
885
}
898
886
899
887
public void afterTextChanged (Editable s ) {
0 commit comments