///
bool notifyCursorLeaves(Cursor const & old, Cursor & cur);
///
- void read(Buffer const &, Lexer & lex);
+ void read(Lexer & lex);
///
- void write(Buffer const &, std::ostream & os) const;
+ void write(std::ostream & os) const;
///
void write(WriteStream & os) const;
/// Output LaTeX code, but assume that the macro is not definied yet
/// if overwriteRedefinition is true
void write(WriteStream & os, bool overwriteRedefinition) const;
///
- int plaintext(Buffer const &, odocstream &,
- OutputParams const &) const;
+ int plaintext(odocstream &, OutputParams const &) const;
///
bool noFontChange() const { return true; }
InsetCode lyxCode() const { return MATHMACRO_CODE; }
///
void infoize(odocstream & os) const;
+ ///
+ docstring contextMenu(BufferView const &, int, int) const;
protected:
///
/// shift every #n with from<=n, i.e. #n -> #(n-by)
void shiftArguments(size_t from, int by);
///
- void insertParameter(Cursor & cur, int pos, bool greedy = false);
+ void insertParameter(Cursor & cur, int pos, bool greedy = false, bool addarg = true);
///
- void removeParameter(Cursor & cur, int pos, bool greedy = false );
+ void removeParameter(Cursor & cur, int pos, bool greedy = false);
///
void makeOptional(Cursor & cur);
///
idx_type displayIdx() const { return optionals_ + 2; }
///
void updateLook() const;
- /// The representation of the macro tempalte, with some holes to edit
+ /// look through the macro for #n arguments
+ int maxArgumentInDefinition() const;
+ /// add missing #n arguments up to \c maxArg
+ void insertMissingArguments(int maxArg);
+ /// change the arity
+ void changeArity(Cursor & cur, int newNumArg);
+ /// find arguments in definition and adapt the arity accordingly
+ void commitEditChanges(Cursor & cur);
+ /// The representation of the macro template, with some holes to edit
mutable MathData look_;
///
mutable int numargs_;
///
+ mutable int argsInLook_;
+ ///
int optionals_;
/// keeps the old optional default value when an
/// optional argument is disabled
/// defined before already?
mutable bool redefinition_;
///
- void createLook() const;
+ void createLook(int args) const;
///
mutable bool lookOutdated_;
/// true if in pre-calculations of metrics to get height of boxes