From dc2601f3359d44cdaea45d1d7c04920d6b680061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Fri, 3 Mar 2023 21:29:31 +0100 Subject: [PATCH] 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. --- src/game/editor/editor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 1b621f193..f49d6d800 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -4374,6 +4374,10 @@ void CEditor::RenderFileDialog() str_copy(m_aFilesSelectedName, m_vpFilteredFileList[m_FilesSelectedIndex]->m_aName); else 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(); } }