From 746c4772b9049344bfb7742bab87cf8cda10faec Mon Sep 17 00:00:00 2001 From: Derick Payne Date: Tue, 20 Jan 2026 23:30:13 +0200 Subject: [PATCH] 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. --- src/Notepad3.c | 2 +- todo/TODO.md | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Notepad3.c b/src/Notepad3.c index 04cc2d135..21f851ffb 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -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); diff --git a/todo/TODO.md b/todo/TODO.md index 80d447bc9..8738b2e6e 100644 --- a/todo/TODO.md +++ b/todo/TODO.md @@ -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