<p></p>
<p><b>@xiota</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/3021#discussion_r757147744">src/keyfile.c</a>:</p>
<pre style='color:#555'>> @@ -365,6 +365,25 @@ static gchar *get_session_file_string(GeanyDocument *doc)
                ft = filetypes[GEANY_FILETYPES_NONE];
 
        locale_filename = utils_get_locale_from_utf8(doc->file_name);
+       /* use relative path for projects with relative base path and files
+        * inside the base path */
+       if (is_project && app->project && !g_path_is_absolute(app->project->base_path))
+       {
+               gchar *project_dir, *relpath, *base_path;
+               GFile *prjdir, *fname;
+
+               base_path = project_get_base_path();
+               project_dir = utils_get_locale_from_utf8(base_path);
+               prjdir = g_file_new_for_path(project_dir);
+               fname = g_file_new_for_path(locale_filename);
+               relpath = g_file_get_relative_path(prjdir, fname);
</pre>
<p dir="auto">Could you add a comment to note that <code>fname</code> will be <code>NULL</code> if <code>prjdir is not parent of </code>fname<code>to make it clear to people (me) who aren't familiar with</code>g_file_get_relative_path<code>, that it won't create </code>../../etc` type paths.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/3021#pullrequestreview-816320015">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ4LOVQRA3NWZ77BSF3UN23KVANCNFSM5IYZ3XZA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAIOWJ5HOAHY4STN5CTLPSTUN23KVA5CNFSM5IYZ3XZKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOGCUA4DY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/3021#pullrequestreview-816320015",
"url": "https://github.com/geany/geany/pull/3021#pullrequestreview-816320015",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>