Fix opening file in editor with enter not working after searching

The filename of the selected file is tracked separately and was not updated when the search term in the Open File dialog is changed.
This commit is contained in:
Robert Müller 2023-03-03 21:29:31 +01:00
parent 4fa433960b
commit dc2601f335

View file

@ -4374,6 +4374,10 @@ void CEditor::RenderFileDialog()
str_copy(m_aFilesSelectedName, m_vpFilteredFileList[m_FilesSelectedIndex]->m_aName); str_copy(m_aFilesSelectedName, m_vpFilteredFileList[m_FilesSelectedIndex]->m_aName);
else else
m_aFilesSelectedName[0] = '\0'; m_aFilesSelectedName[0] = '\0';
if(m_FilesSelectedIndex >= 0 && !m_vpFilteredFileList[m_FilesSelectedIndex]->m_IsDir)
str_copy(m_aFileDialogFileName, m_vpFilteredFileList[m_FilesSelectedIndex]->m_aFilename);
else
m_aFileDialogFileName[0] = '\0';
s_ListBox.ScrollToSelected(); s_ListBox.ScrollToSelected();
} }
} }