Disable Edit Externally for read-only Buffers.

This commit is contained in:
Richard Kimberly Heck 2020-12-06 00:14:23 -05:00
parent 16834a32ad
commit c978137f99

View 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: