Fix: Allow saving unmodified files when strip blanks is enabled (fixes #5444)

Added Settings.FixTrailingBlanks check to FileSave() early return condition, allowing save to proceed when strip trailing blanks is enabled even if document appears unmodified.
This commit is contained in:
Derick Payne 2026-01-20 23:30:13 +02:00
parent e8108429e3
commit 746c4772b9
2 changed files with 3 additions and 4 deletions

View File

@ -12046,7 +12046,7 @@ bool FileSave(FileSaveFlags fSaveFlags)
bool const bSaveNeeded = (IsSaveNeeded() || IsFileChangedFlagSet()) && !bIsEmptyNewFile;
if (!(fSaveFlags & FSF_SaveAs) && !(fSaveFlags & FSF_SaveAlways) && !bSaveNeeded) {
if (!(fSaveFlags & FSF_SaveAs) && !(fSaveFlags & FSF_SaveAlways) && !bSaveNeeded && !Settings.FixTrailingBlanks) {
_MRU_UpdateSession();
AutoSaveStop();
ResetFileObservationData(true);

View File

@ -102,10 +102,9 @@
- Issue: [#1129](https://github.com/rizonesoft/Notepad3/issues/1129)
- [ ] **(Q2) Improve Temp File Handling** - Better UX for files from archives
- Issue: [#5343](https://github.com/rizonesoft/Notepad3/issues/5343)
- [ ] **(Q1) Force Save Option** - Allow saving unmodified files for strip trailing blanks
- [x] **(Q1) Force Save Option** - ✅ FIXED
- Issue: [#5444](https://github.com/rizonesoft/Notepad3/issues/5444)
- Code: `Notepad3.c:12042` - `bSaveNeeded` check skips save on unmodified files
- Fix: Check strip-blanks setting before early return at line 12044
- Fix: Added `Settings.FixTrailingBlanks` check to early return in `FileSave()`
## GitHub Actions