, this argument is automatically inserted when the respective style is selected.
Currently, only one argument per style\SpecialChar breakableslash
layout can be automatically inserted.
-\change_inserted -712698321 1431070519
+\change_inserted -712698321 1431166542
\end_layout
\begin_layout Itemize
+\change_inserted -712698321 1431166604
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1431166548
+InsertCotext
+\end_layout
+
+\end_inset
+
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1431166543
+[int=0]
+\end_layout
+
+\end_inset
+
+ If this is set to
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1431166543
+1
+\end_layout
+
+\end_inset
+
+, this argument will bei inserted with a copy of the co-text (either selected
+ text or the whole paragraph) as content.
+\end_layout
+
+\begin_layout Itemize
+
\change_inserted -712698321 1431070588
\lang ngerman
// writeArgument() makes use of these default values
arg.mandatory = false;
arg.autoinsert = false;
+ arg.insertcotext = false;
bool error = false;
bool finished = false;
arg.font = inherit_font;
} else if (tok == "autoinsert") {
lex.next();
arg.autoinsert = lex.getBool();
+ } else if (tok == "insertcotext") {
+ lex.next();
+ arg.insertcotext = lex.getBool();
} else if (tok == "leftdelim") {
lex.next();
arg.ldelim = lex.getDocString();
os << "\t\tMandatory " << arg.mandatory << '\n';
if (arg.autoinsert)
os << "\t\tAutoinsert " << arg.autoinsert << '\n';
+ if (arg.insertcotext)
+ os << "\t\tInsertCotext " << arg.insertcotext << '\n';
if (!arg.ldelim.empty())
os << "\t\tLeftDelim \""
<< to_utf8(subst(arg.ldelim, from_ascii("\n"), from_ascii("<br/>")))
FontInfo font;
FontInfo labelfont;
bool autoinsert;
+ bool insertcotext;
docstring pass_thru_chars;
};
///
}
return true;
}
+ else if (cmd.action() == LFUN_ARGUMENT_INSERT) {
+ bool cotextinsert = false;
+ InsetArgument const * const ia = static_cast<InsetArgument const *>(inset);
+ Layout const & lay = cur.paragraph().layout();
+ Layout::LaTeXArgMap args = lay.args();
+ Layout::LaTeXArgMap::const_iterator const lait = args.find(ia->name());
+ if (lait != args.end())
+ cotextinsert = (*lait).second.insertcotext;
+ // The argument requests to insert a copy of the co-text to the inset
+ if (cotextinsert) {
+ docstring ds;
+ // If we have a selection within a paragraph, use this
+ if (cur.selection() && cur.selBegin().pit() == cur.selEnd().pit())
+ ds = cur.selectionAsString(false);
+ // else use the whole paragraph
+ else
+ ds = cur.paragraph().asString();
+ text->insertInset(cur, inset);
+ if (edit)
+ inset->edit(cur, true);
+ // Now put co-text into inset
+ Font const f(inherit_font, cur.current_font.language());
+ if (!ds.empty()) {
+ cur.text()->insertStringAsLines(cur, ds, f);
+ cur.leaveInset(*inset);
+ }
+ return true;
+ }
+ }
bool gotsel = false;
if (cur.selection()) {
Layout::latexarg arg;
arg.mandatory = false;
arg.autoinsert = false;
+ arg.insertcotext = false;
bool error = false;
bool finished = false;
arg.font = inherit_font;
} else if (tok == "autoinsert") {
lex.next();
arg.autoinsert = lex.getBool();
+ } else if (tok == "insertcotext") {
+ lex.next();
+ arg.insertcotext = lex.getBool();
} else if (tok == "leftdelim") {
lex.next();
arg.ldelim = lex.getDocString();