Skip to content

Commit

Permalink
On clicking, ask to delete non-existing path from MRU list, issue #740.
Browse files Browse the repository at this point in the history
Patch by @Sergy2001
  • Loading branch information
zufuliu committed Dec 3, 2023
1 parent 4ed2335 commit 2bdc014
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1274,8 +1274,8 @@ static INT_PTR CALLBACK FileMRUDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPAR
if (!PathIsFile(tch)) {
// Ask...
if (IDYES == MsgBoxWarn(MB_YESNO, IDS_ERR_MRUDLG)) {
MRU_Delete(pFileMRU, lvi.iItem);
MRU_DeleteFileFromStore(pFileMRU, tch);
MRU_Delete(pFileMRU, lvi.iItem);

// must use recreate the list, index might change...
//ListView_DeleteItem(hwndLV, lvi.iItem);
Expand Down
7 changes: 6 additions & 1 deletion src/Notepad2.c
Original file line number Diff line number Diff line change
Expand Up @@ -5007,7 +5007,12 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) {
if (index < MRU_MAXITEMS) {
LPCWSTR path = pFileMRU->pszItems[index];
if (path) {
if (FileSave(FileSaveFlag_Ask)) {
if (!PathIsFile(path)) {
if (IDYES == MsgBoxWarn(MB_YESNO, IDS_ERR_MRUDLG)) {
MRU_DeleteFileFromStore(pFileMRU, path);
MRU_Delete(pFileMRU, index);
}
} else if (FileSave(FileSaveFlag_Ask)) {
FileLoad(FileLoadFlag_DontSave, path);
}
}
Expand Down

0 comments on commit 2bdc014

Please sign in to comment.