case LFUN_BUFFER_RELOAD: {
LASSERT(doc_buffer, break);
- docstring const file = makeDisplayPath(doc_buffer->absFileName(), 20);
- docstring text = bformat(_("Any changes will be lost. Are you sure "
- "you want to revert to the saved version of the document %1$s?"), file);
- int const ret = Alert::prompt(_("Revert to saved document?"),
- text, 1, 1, _("&Revert"), _("&Cancel"));
+
+ int ret = 0;
+ if (!doc_buffer->isClean()) {
+ docstring const file =
+ makeDisplayPath(doc_buffer->absFileName(), 20);
+ docstring text = bformat(_("Any changes will be lost. "
+ "Are you sure you want to revert to the saved version "
+ "of the document %1$s?"), file);
+ ret = Alert::prompt(_("Revert to saved document?"),
+ text, 1, 1, _("&Revert"), _("&Cancel"));
+ }
if (ret == 0) {
doc_buffer->markClean();