Skip to content

Commit e364485

Browse files
committed
Save on deactivate #164: skip execution of FileSave() when document is not modified
1 parent 8d0b1a2 commit e364485

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

bin/Notepad2e.exe

0 Bytes
Binary file not shown.

src/Notepad2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,8 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
866866
n2e_SelectionEditStop(SES_APPLY);
867867
// [2e]: Save on deactivate #164
868868
static BOOL bSaveInProgress = FALSE;
869-
if ((iSaveOnLoseFocus != SLF_DISABLED) && !bSaveInProgress && IsWindowVisible(hwnd))
869+
if (bModified && (iSaveOnLoseFocus != SLF_DISABLED)
870+
&& !bSaveInProgress && IsWindowVisible(hwnd))
870871
{
871872
bSaveInProgress = TRUE;
872873
FileSave(TRUE, FALSE, FALSE, FALSE, FALSE);

0 commit comments

Comments
 (0)