Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions Src/FilepathEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,20 @@ void CFilepathEdit::OnContextMenuSelected(UINT nID)
}
case ID_EDITOR_SELECT_FILE:
{
CString text;
GetWindowText(text);
if (!text.IsEmpty() && text[0] == '*')
text = text.Right(text.GetLength() - 2);
String dir = paths::GetParentPath(static_cast<const tchar_t*>(text));
String dir;
if (!m_sFilepath.empty())
{
// the displayed text may be a custom caption or a compacted path: use the real path
dir = paths::GetParentPath(m_sFilepath);
}
else
{
CString text;
GetWindowText(text);
if (!text.IsEmpty() && text[0] == '*')
text = text.Right(text.GetLength() - 2);
dir = paths::GetParentPath(static_cast<const tchar_t*>(text));
}
bool selected = false;
if (m_bEnabledFileSelection)
selected = SelectFile(m_hWnd, m_sFilepath, true, dir.c_str());
Expand Down
Loading