Use the backup to solve the residual after deleting the code.

This commit is contained in:
Fx
2020-03-01 15:07:59 +08:00
parent 8cab65ee1d
commit bf8a128fa6

View File

@@ -427,6 +427,8 @@ public class EditorView extends FrameLayout implements CodeCompletionBar.OnHintC
}
public Observable<String> save() {
String path = mUri.getPath();
PFiles.move(path, path + ".bak");
return Observable.just(mEditor.getText())
.observeOn(Schedulers.io())
.doOnNext(s -> PFiles.write(getContext().getContentResolver().openOutputStream(mUri), s))