Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default filenames (.copy-xx) to cloned documents #1191

Closed
wants to merge 8 commits into from
13 changes: 10 additions & 3 deletions src/document.c
Expand Up @@ -3356,10 +3356,17 @@ GeanyDocument *document_clone(GeanyDocument *old_doc)
}
}

if (unused && !g_file_test(candidate, G_FILE_TEST_EXISTS))
if (unused)
{
new_filename = candidate;
break;
gchar *locale_candidate = utils_get_locale_from_utf8(candidate);
gboolean file_exists = g_file_test(locale_candidate, G_FILE_TEST_EXISTS);
g_free(locale_candidate);

if (!file_exists)
{
new_filename = candidate;
break;
}
}

g_free(candidate);
Expand Down