fix(ui): cannot redo and undo
This commit is contained in:
@@ -144,7 +144,7 @@ public class CodeEditor extends HVScrollView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUndo() {
|
public boolean canUndo() {
|
||||||
return mTextViewRedoUndo.canRedo();
|
return mTextViewRedoUndo.canUndo();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canRedo() {
|
public boolean canRedo() {
|
||||||
|
|||||||
@@ -419,6 +419,9 @@ public class TextViewUndoRedo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
|
if (mIsUndoOrRedo || !mEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (mEditHistory.size() < mInitialHistoryStackSize) {
|
if (mEditHistory.size() < mInitialHistoryStackSize) {
|
||||||
mInitialHistoryStackSize = 0;
|
mInitialHistoryStackSize = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,10 +111,10 @@ public class DebugToolbarFragment extends ToolbarFragment implements DebugCallba
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CodeEditor editor = mEditorView.getEditor();
|
CodeEditor editor = mEditorView.getEditor();
|
||||||
editor.setRedoUndoEnabled(true);
|
|
||||||
if (!TextUtils.equals(mInitialEditorSourceUrl, mCurrentEditorSourceUrl)) {
|
if (!TextUtils.equals(mInitialEditorSourceUrl, mCurrentEditorSourceUrl)) {
|
||||||
editor.setText(mInitialEditorSource);
|
editor.setText(mInitialEditorSource);
|
||||||
}
|
}
|
||||||
|
editor.setRedoUndoEnabled(true);
|
||||||
DebugBar debugBar = mEditorView.getDebugBar();
|
DebugBar debugBar = mEditorView.getDebugBar();
|
||||||
debugBar.setTitle(null);
|
debugBar.setTitle(null);
|
||||||
debugBar.setCodeEvaluator(null);
|
debugBar.setCodeEvaluator(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user