Hi,
Le 16/08/2010 02:51, Erik de Castro Lopo a écrit :
> Jiří Techet wrote:
>
>>
>> When reloading a file with ctrl+R don't display the warning dialog
>> that the unsaved changes might be lost when the file has not been
>> modified.
>
> I've been running with this patch for about a week. Looks good to me.
This one seems to have been applied as r5190, and I have a little
complain about it, so perhaps it would need a little more thought.
The problem is that reloading a document not only looses unsaved
changes, but also undo/redo stack. This is particularly annoying if you
hit the shortcut by accident (which I unfortunately did :( ).
So I propose to two possible solutions:
1) simply check whether there's possible undo/redo, and if yes, ask
before reloading (little patch joined);
2) the solution 1 fixes my problem, but probably not (?) for somebody
that was annoyed by this dialog like Jiří was. So, perhaps a... setting
(!) would be useful?
What do you think?
Regards,
Colomban
Index: src/callbacks.c
===================================================================
--- src/callbacks.c (révision 5232)
+++ src/callbacks.c (copie de travail)
@@ -485,7 +485,7 @@
charset = doc->encoding;
base_name = g_path_get_basename(doc->file_name);
- if (!doc->changed ||
+ if ((!doc->changed && !document_can_undo(doc) && !document_can_redo(doc)) ||
dialogs_show_question_full(NULL, _("_Reload"), GTK_STOCK_CANCEL,
_("Any unsaved changes will be lost."),
_("Are you sure you want to reload '%s'?"), base_name))
_______________________________________________
Geany-devel mailing list
[email protected]
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel