Skip to content

Commit 291a586

Browse files
committed
change 3 space to 2 space
1 parent 7974ff5 commit 291a586

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

libCompiler/src/main/java/com/duy/pascal/frontend/editor/view/HighlightEditor.java

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public class HighlightEditor extends CodeSuggestsEditText
111111
private boolean[] isGoodLineArray;
112112
private int[] realLines;
113113
private int lineCount;
114-
private boolean isFind = false;
114+
private boolean isFinding = false;
115115
/**
116116
* Disconnect this undo/redo from the text
117117
* view.
@@ -120,8 +120,7 @@ public class HighlightEditor extends CodeSuggestsEditText
120120
/**
121121
* The change listener.
122122
*/
123-
private EditTextChangeListener
124-
mChangeListener;
123+
private EditTextChangeListener mChangeListener;
125124
private int numberWidth = 0;
126125
private AutoFixError mAutoFixError;
127126
private Highlighter mHighlighter;
@@ -508,7 +507,6 @@ public int getFirstLineIndex() {
508507
*
509508
* @return last lineInfo that is visible on the screen.
510509
*/
511-
@SuppressWarnings("unused")
512510
public int getLastLineIndex() {
513511
int height;
514512
if (verticalScroll != null) {
@@ -767,7 +765,7 @@ public void pinLine(@Nullable LineInfo lineInfo) {
767765
}
768766

769767
public void highlightText() {
770-
if (isFind) return;
768+
if (isFinding) return;
771769

772770
disableTextChangedListener();
773771
highlight(getEditableText(), false);
@@ -806,26 +804,16 @@ private void clearSpans(Editable e, int start, int end) {
806804
}
807805

808806
public Editable highlight(Editable editable, boolean newText) {
809-
// editable.clearSpans();
810807
if (editable.length() == 0) {
811808
return editable;
812809
}
813810

814811
int editorHeight = getHeightVisible();
815-
816812
int firstVisibleIndex;
817813
int lastVisibleIndex;
818814
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());
829817
} else {
830818
firstVisibleIndex = 0;
831819
lastVisibleIndex = CHARS_TO_COLOR;
@@ -893,7 +881,7 @@ public void onTextChanged(CharSequence s,
893881
int count) {
894882
this.start = start;
895883
this.count = count;
896-
isFind = false;
884+
isFinding = false;
897885
}
898886

899887
public void afterTextChanged(Editable s) {

0 commit comments

Comments
 (0)