]> git.lyx.org Git - features.git/commitdiff
Disable Edit Externally for read-only Buffers.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Sun, 6 Dec 2020 05:14:23 +0000 (00:14 -0500)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Sun, 6 Dec 2020 05:14:23 +0000 (00:14 -0500)
src/insets/InsetCollapsible.cpp

index 1e5473dc11d9677ce2bee0023d32974d0fa9c92b..58f45b53134398b638e35f5447da440954518743 100644 (file)
@@ -651,11 +651,13 @@ bool InsetCollapsible::getStatus(Cursor & cur, FuncRequest const & cmd,
                return true;
 
        case LFUN_INSET_EDIT:
-               flag.setEnabled(getLayout().editExternally() && tempfile_ == nullptr);
+               flag.setEnabled(!buffer().hasReadonlyFlag() &&
+                       getLayout().editExternally() && tempfile_ == nullptr);
                return true;
 
        case LFUN_INSET_END_EDIT:
-               flag.setEnabled(getLayout().editExternally() && tempfile_ != nullptr);
+               flag.setEnabled(!buffer().hasReadonlyFlag() &&
+                       getLayout().editExternally() && tempfile_ != nullptr);
                return true;
 
        default: