+ if (par != end && !isInline && !captionline)
+ code += "\n";
+ }
+ if (isInline) {
+ static const docstring delimiters =
+ from_utf8("!*()-=+|;:'\"`,<.>/?QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm");
+
+ size_t pos = delimiters.find_first_not_of(code);
+
+ // This code piece contains all possible special character? !!!
+ // Replace ! with a warning message and use ! as delimiter.
+ if (pos == string::npos) {
+ docstring delim_error = "<" + _("LyX Warning: ")
+ + _("no more lstline delimiters available") + ">";
+ code = subst(code, from_ascii("!"), delim_error);
+ pos = 0;
+ if (!runparams.dryrun && !runparams.silent) {
+ // FIXME: warning should be passed to the error dialog
+ frontend::Alert::warning(_("Running out of delimiters"),
+ _("For inline program listings, one character must be reserved\n"
+ "as a delimiter. One of the listings, however, uses all available\n"
+ "characters, so none is left for delimiting purposes.\n"
+ "For the time being, I have replaced '!' by a warning, but you\n"
+ "must investigate!"));
+ }
+ }
+ docstring const delim(1, delimiters[pos]);
+ os << "\\lstinline";
+ if (!param_string.empty())
+ os << "[" << from_utf8(param_string) << "]";
+ else if (pos >= delimiters.find('Q'))
+ // We need to terminate the command before the delimiter
+ os << " ";
+ os << delim << code << delim;
+ } else {
+ OutputParams rp = runparams;
+ rp.moving_arg = true;
+ TexString caption = getCaption(rp);
+ os << breakln << "\\begin{lstlisting}";
+ if (param_string.empty() && caption.str.empty())