Hi. When renaming a file opened in geany with `disk_check_timeout!=0` a prompt is correctly displayed. Renaming it back again, and reloading it (File->Reload) everything *seems* fine. However, if the project is then closed and reopened, that file is gone. I did not totally verify this, but my educated guess is: In document.c:monitor_resave_missing_file the `real_path` of the missing is set to null `SETPTR(doc->real_path, NULL);` Reloading the file does not change this. In keyfile.c:configuration_save_session_files `if (doc != NULL && doc->real_path != NULL)` `real_path` is still null (unless manually saved before), so the file is gone. Suggested fix (seems to be working):
~~~ document.c:document_open_file_full if (! reload) { doc = document_create(utf8_filename); g_return_val_if_fail(doc != NULL, NULL); /* really should not happen */
/* file exists on disk, set real_path */ SETPTR(doc->real_path, utils_get_real_path(locale_filename));
doc->priv->is_remote = utils_is_remote_path(locale_filename); monitor_file_setup(doc); } + else { + if( doc != NULL ){ + SETPTR(doc->real_path, utils_get_real_path(locale_filename)); + } + } ~~~
Thanks. Tycho
Can you make a PR with this fix?
Yes, but my time is quite limited these days. It will take a week or two ..
github-comments@lists.geany.org