diff --git a/CHANGELOG.md b/CHANGELOG.md index a52724d8..a35d4964 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,13 @@ - messages, search results: exclude backticks if the option _backTicksHighlight_ is enabled. +## Bugs fixed + +- diff dialog: the content reloaded matched to the state when the dialog was shown, not when closed. (#97) + # v3.9.12 -## Enhancement +## Enhancements - editor: a new option, _textCompletion_, sets if the completion menu includes the identifiers obtained by word-splitting the whole document. (#85) - editor: prevent completion menu to show on fast enough (< to the _autoDotDelay_ setting) `..`. @@ -58,7 +62,7 @@ # v3.9.9 -## Enhancement +## Enhancements - GDB commander: The widget is now activated on Windows systems. Note that it might only works if the project is compiled with LDC >= 1.23.0 and if debug info are generated and if the _-gdwarf_ switch is also part of the config. See [LDC announcement](https://forum.dlang.org/post/ssvxmrdpklhsrqlgrzas@forum.dlang.org). GDB for windows can be found [here](https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Alternative%20GDB/) for example. diff --git a/src/u_synmemo.pas b/src/u_synmemo.pas index 59b2531c..caf1df91 100644 --- a/src/u_synmemo.pas +++ b/src/u_synmemo.pas @@ -3506,9 +3506,19 @@ var newDate : double; newMd5 : TMDDigest; curMd5 : TMDDigest; - str : TStringList; - newTxt : string; p : TPoint; + + function reload(): string; + begin + with TStringList.Create() do + try + LoadFromFile(fFilename); + result := strictText(); + finally + Free; + end; + end; + begin if fDiffDialogWillClose or fDisableFileDateCheck then exit; @@ -3523,14 +3533,7 @@ begin exit; if (fFileDate <> 0.0) then begin - str := TStringList.Create; - try - str.LoadFromFile(fFilename); - newTxt := str.strictText; - finally - str.Free; - end; - newMd5 := MD5String(newTxt); + newMd5 := MD5String(reload()); curMd5 := MD5String(lines.strictText); if not MDMatch(curMd5, newMd5) then begin @@ -3542,7 +3545,7 @@ begin case mr of mrOK: begin - replaceUndoableContent(newTxt); + replaceUndoableContent(reload()); fModified := false; fFileDate := newDate; fCanDscan := true; @@ -3552,7 +3555,7 @@ begin fCanDscan := true; p := self.CaretXY; fModified := false; - self.text := newTxt; + self.text := reload(); fFileDate := newDate; CaretXY := p; end;