mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
Safe line break to increase precision of error reporting in Listings caption
This commit is contained in:
parent
d9c52c7a3f
commit
e798db5739
@ -79,6 +79,8 @@ public:
|
||||
This esentially seems to mean whether InsetInclude, InsetGraphics
|
||||
and InsetExternal should add the absolute path to any external
|
||||
files or not.
|
||||
Non-nice LaTeX also includes additional safe line breaks in order to
|
||||
increase the precision of forward/reverse search and error reporting.
|
||||
*/
|
||||
bool nice;
|
||||
|
||||
|
@ -224,10 +224,13 @@ void InsetListings::latex(otexstream & os, OutputParams const & runparams) const
|
||||
OutputParams rp = runparams;
|
||||
rp.moving_arg = true;
|
||||
TexString caption = getCaption(rp);
|
||||
os << breakln << "\\begin{lstlisting}";
|
||||
if (param_string.empty() && caption.str.empty())
|
||||
os << breakln << "\\begin{lstlisting}\n";
|
||||
os << "\n";
|
||||
else {
|
||||
os << breakln << "\\begin{lstlisting}[";
|
||||
if (!runparams.nice)
|
||||
os << safebreakln;
|
||||
os << "[";
|
||||
if (!caption.str.empty()) {
|
||||
os << "caption={" << move(caption) << '}';
|
||||
if (!param_string.empty())
|
||||
|
Loading…
Reference in New Issue
Block a user