Skip to content

Commit

Permalink
Fix after review (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyinkin committed Oct 31, 2022
1 parent 78a0ee9 commit d66f789
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/src/history/code_history_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ class CodeHistoryController {

void beforeChanged(Code code, TextSelection selection) {
_dropRedoIfNeed();
bool save = false;
bool shouldSave = false;

if (_isTextChanged) {
save = code.lines.lines.length != lastCode.lines.lines.length;
shouldSave = code.lines.lines.length != lastCode.lines.lines.length;
}

if (!save) {
if (!shouldSave) {
if (lastCode.text != code.text) {
_isTextChanged = true;
}
Expand All @@ -60,12 +60,12 @@ class CodeHistoryController {
if (isTypingContinuous) {
_setTimer();
} else {
save = true;
shouldSave = true;
}
}
}

if (save) {
if (shouldSave) {
_push();
}

Expand Down

0 comments on commit d66f789

Please sign in to comment.