Commit deb2af02 authored by Matthias Schneider's avatar Matthias Schneider Committed by Jordi Mas

gedit-commands-file.c: Only save if file has been modified

parent 79ff20c4
Pipeline #78718 passed with stage
in 5 minutes and 33 seconds
......@@ -1079,13 +1079,28 @@ _gedit_cmd_file_save (GSimpleAction *action,
{
GeditWindow *window = GEDIT_WINDOW (user_data);
GeditTab *tab;
GeditDocument *doc;
gedit_debug (DEBUG_COMMANDS);
tab = gedit_window_get_active_tab (window);
if (tab != NULL)
{
save_tab (tab, window);
doc = gedit_tab_get_document (tab);
g_return_if_fail (doc != NULL);
if (_gedit_document_needs_saving (doc) ||
gedit_document_is_untitled (doc))
{
save_tab (tab, window);
}
else
{
gedit_statusbar_flash_message (GEDIT_STATUSBAR (window->priv->statusbar),
window->priv->generic_message_cid,
_("No changes need to be saved"));
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment