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