Skip to content

Commit

Permalink
Fix 'Double search and F4 cause file delete' (see elfmz#2223)
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed May 24, 2024
1 parent 3a48a37 commit f84f4fd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions far/src/findfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1916,9 +1916,13 @@ static LONG_PTR WINAPI FindDlgProc(HANDLE hDlg, int Msg, int Param1, LONG_PTR Pa
// FindFileArcIndex нельзя здесь использовать
// Он может быть уже другой.
if (FindItem.ArcIndex != LIST_INDEX_NONE) {
TFH = std::make_shared<FindDlg_TempFileHolder>(strSearchFileName,
FindItem.ArcIndex, FindItem.FindData);
ShellEditor.SetFileHolder(TFH);
ARCLIST Item;
itd.GetArcListItem(FindItem.ArcIndex, Item);
if (0 == (Item.Flags & OPIF_REALNAMES)) { // see https://github.com/elfmz/far2l/issues/2223
TFH = std::make_shared<FindDlg_TempFileHolder>(strSearchFileName,
FindItem.ArcIndex, FindItem.FindData);
ShellEditor.SetFileHolder(TFH);
}
}
FrameManager->ExecuteModalEV();
if (TFH) {
Expand Down

0 comments on commit f84f4fd

Please sign in to comment.