mirror of
https://github.com/chaos-zhu/easynode.git
synced 2026-10-07 11:43:38 +08:00
fix(mobile): 编辑器打开即提示未保存
CodeLineEditingController 解析时会把 CRLF 规范化为 LF,导致 code.text 与原始 _originalText 不一致,isDirty 误报为 true。 改为以解析后的 code.text 作为 baseline 进行比较。
This commit is contained in:
@@ -16,8 +16,9 @@ class TextEditorController extends ChangeNotifier {
|
||||
required this.language,
|
||||
required this.totalBytes,
|
||||
}) : _writer = writer,
|
||||
_originalText = originalText,
|
||||
_originalText = '',
|
||||
code = CodeLineEditingController.fromText(originalText) {
|
||||
_originalText = code.text;
|
||||
code.addListener(_onCodeChanged);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user