Abdelrazak Younes wrote: > This is now bug 4359: > > http://bugzilla.lyx.org/show_bug.cgi?id=4359
Patch for branch attached. Jürgen
Index: src/insets/InsetOptArg.cpp =================================================================== --- src/insets/InsetOptArg.cpp (Revision 21626) +++ src/insets/InsetOptArg.cpp (Arbeitskopie) @@ -12,6 +12,9 @@ #include "InsetOptArg.h" +#include "FuncRequest.h" +#include "FuncStatus.h" + #include "debug.h" #include "gettext.h" @@ -55,6 +58,23 @@ } +bool InsetOptArg::getStatus(Cursor & cur, FuncRequest const & cmd, + FuncStatus & status) const +{ + switch (cmd.action) { + // paragraph breaks not allowed + case LFUN_BREAK_PARAGRAPH: + case LFUN_BREAK_PARAGRAPH_KEEP_LAYOUT: + case LFUN_BREAK_PARAGRAPH_SKIP: + status.enabled(false); + return true; + + default: + return InsetCollapsable::getStatus(cur, cmd, status); + } +} + + void InsetOptArg::write(Buffer const & buf, ostream & os) const { os << "OptArg" << "\n"; Index: src/insets/InsetOptArg.h =================================================================== --- src/insets/InsetOptArg.h (Revision 21626) +++ src/insets/InsetOptArg.h (Arbeitskopie) @@ -52,6 +52,8 @@ virtual bool neverIndent(Buffer const &) const { return true; } protected: InsetOptArg(InsetOptArg const &); + /// + bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const; private: virtual std::auto_ptr<Inset> doClone() const; };