# HG changeset patch # User Markus Mützel # Date 1713191828 -7200 # Node ID f64d8e86b0fc32a560138ad32c9887377cd43d9e # Parent abce1aa7f66f2ea43a86c86788d5873f05198298 gui: Allow executing new files from built-in editor with F5 (bug #65548). * libgui/src/main-window.cc (main_window::run_file_in_terminal): Rehash load path before executing file. diff -r abce1aa7f66f -r f64d8e86b0fc libgui/src/main-window.cc --- a/libgui/src/main-window.cc Mon Apr 15 13:44:26 2024 +0200 +++ b/libgui/src/main-window.cc Mon Apr 15 16:37:08 2024 +0200 @@ -1167,6 +1167,13 @@ 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 (); + std::string path = info.absolutePath ().toStdString (); if (lp.contains_file_in_dir (file_path, path))