# HG changeset patch # User Markus Mützel # Date 1735486385 -3600 # Sun Dec 29 16:33:05 2024 +0100 # Node ID 9806ede4d63e9bca1295bdd68a10b4be7442c925 # Parent 8fa4381ebe4b0a770303969080264ec73874cdbd Rehash load path after saving file to disc (bug #31080). * libgui/src/m-editor/file-editor-tab.cc (file_editor_tab::do_save_file): Rehash load path each time a file is saved to the disc with the built-in editor. diff --git a/libgui/src/m-editor/file-editor-tab.cc b/libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc +++ b/libgui/src/m-editor/file-editor-tab.cc @@ -2567,6 +2567,22 @@ file_editor_tab::do_save_file (const QSt // breakpoints would reopen the tab in this case. if (restore_breakpoints) check_restore_breakpoints (); + + // re-hash load-path + emit interpreter_event + ([=] (interpreter& interp) + { + // INTERPRETER THREAD + + load_path& lp = interp.get_load_path (); + + // Rehashing the load path is only needed when executing new files + // in the built-in editor for the first time and the command line + // prompt hasn't been displayed yet again since this *new* file has + // been saved for the first time. + // FIXME: Is there a way to detect here that a file is new? + lp.rehash (); + }); } else {