<p></p>
<p dir="auto">Hi.<br>
When renaming a file opened in geany with <code class="notranslate">disk_check_timeout!=0</code> a prompt is correctly displayed. Renaming it back again, and reloading it (File->Reload) everything <em>seems</em> fine. However, if the project is then closed and reopened, that file is gone.<br>
I did not totally verify this, but my educated guess is:<br>
In document.c:monitor_resave_missing_file the <code class="notranslate">real_path</code> of the missing is set to null <code class="notranslate">SETPTR(doc->real_path, NULL);</code><br>
Reloading the file does not change this.<br>
In keyfile.c:configuration_save_session_files<br>
<code class="notranslate">if (doc != NULL && doc->real_path != NULL)</code><br>
<code class="notranslate">real_path</code> is still null (unless manually saved before), so the file is gone.<br>
Suggested fix (seems to be working):</p>
<pre class="notranslate"><code class="notranslate"> 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));
+                       }
+               }
</code></pre>
<p dir="auto">Thanks.<br>
Tycho</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/3202">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ4KKQ62MOICIBQRNF3VJYLZZANCNFSM5V2XYQCQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJ32KAQDEKM274OR27TVJYLZZA5CNFSM5V2XYQC2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4SM32KKA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><geany/geany/issues/3202</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/3202",
"url": "https://github.com/geany/geany/issues/3202",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>