mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +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
|
This esentially seems to mean whether InsetInclude, InsetGraphics
|
||||||
and InsetExternal should add the absolute path to any external
|
and InsetExternal should add the absolute path to any external
|
||||||
files or not.
|
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;
|
bool nice;
|
||||||
|
|
||||||
|
@ -224,10 +224,13 @@ void InsetListings::latex(otexstream & os, OutputParams const & runparams) const
|
|||||||
OutputParams rp = runparams;
|
OutputParams rp = runparams;
|
||||||
rp.moving_arg = true;
|
rp.moving_arg = true;
|
||||||
TexString caption = getCaption(rp);
|
TexString caption = getCaption(rp);
|
||||||
|
os << breakln << "\\begin{lstlisting}";
|
||||||
if (param_string.empty() && caption.str.empty())
|
if (param_string.empty() && caption.str.empty())
|
||||||
os << breakln << "\\begin{lstlisting}\n";
|
os << "\n";
|
||||||
else {
|
else {
|
||||||
os << breakln << "\\begin{lstlisting}[";
|
if (!runparams.nice)
|
||||||
|
os << safebreakln;
|
||||||
|
os << "[";
|
||||||
if (!caption.str.empty()) {
|
if (!caption.str.empty()) {
|
||||||
os << "caption={" << move(caption) << '}';
|
os << "caption={" << move(caption) << '}';
|
||||||
if (!param_string.empty())
|
if (!param_string.empty())
|
||||||
|
Loading…
Reference in New Issue
Block a user