Skip to content

Commit

Permalink
Disable "Save" menu and button for unmodified file, use "Save" button…
Browse files Browse the repository at this point in the history
… to indicate whether current file is modified or not, fix issue #102.
  • Loading branch information
zufuliu committed Feb 20, 2019
1 parent c58f767 commit a2c367d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Notepad2.c
Expand Up @@ -2123,6 +2123,7 @@ void MsgInitMenu(HWND hwnd, WPARAM wParam, LPARAM lParam) {
HMENU hmenu = (HMENU)wParam;

int i = StrNotEmpty(szCurFile);
EnableCmd(hmenu, IDM_FILE_SAVE, IsDocumentModified());
EnableCmd(hmenu, IDM_FILE_REVERT, i);
EnableCmd(hmenu, CMD_RELOADANSIASUTF8, i);
EnableCmd(hmenu, CMD_RELOADANSI, i);
Expand Down Expand Up @@ -6560,6 +6561,7 @@ void UpdateToolbar(void) {

EnableTool(IDT_FILE_ADDTOFAV, StrNotEmpty(szCurFile));

EnableTool(IDT_FILE_SAVE, IsDocumentModified());
EnableTool(IDT_EDIT_UNDO, SendMessage(hwndEdit, SCI_CANUNDO, 0, 0) /*&& !bReadOnly*/);
EnableTool(IDT_EDIT_REDO, SendMessage(hwndEdit, SCI_CANREDO, 0, 0) /*&& !bReadOnly*/);

Expand Down

0 comments on commit a2c367d

Please sign in to comment.