We have a mix in this file of boolean stored as such or as strings.
This translates to values written as true/false or 1/0 in .lyx files.
In this case, the value of use_minted could only be true, since the
char * pointer is non null.
Also add some else clauses.
Spotted by coverity.
This is a consequence of e91572a0, although it is not clear why. The
contextMenuEvent code of the workarea should not delegate context
menu when it cannot honor it.
Also fix a small memory leak.
Fixes bug #10616.
The code in InsetLabel::updateReferences code changes reference insets
in potentially several buffers. When recording undo, it is important
to use the right undo stack, otherwise crashes can ensue.
Once it is done, it is neccessary to create undo groups as needed.
This is done using UndoGroupHelper. This demonstrates a shortcoming of
UndoGroup helper: if a buffer is encountered in two seperate
occasions, two undo groups will be created for this buffer. This is
not correct.
Fixes bug #10643.
While 522516d9 was too strong and broke mathed, d0acc3e570 is too
lenient and can accept insets (mathed/CommandInset, InsetInfo) that
have a positive nargs() but are not editable (because they encapsulate
something).
Therefore the best solution for now is to use editable() in text and
isActive() in mathed, until those two things are merged.
Part of #10667.
(required because filesystems return listings in undeterministic order)
to generate Resources.qrc and thereby Resources.cpp and the lyx binary
in a reproducible way
Setting LC_ALL=C because sort order might vary with locales.
See https://reproducible-builds.org/ for why this matters.
Fixes#10711.
Pygments versions prior to 2.0 only accept lower case names for lexers.
This commit makes sure to always use lower case names for the language
that is written in the LaTeX file, while retaining the proper casing
for the presentation in the GUI, which is dictated by compatibility
with the listings package. Moreover, if one switches from listings
to minted in a document, the language combo is properly updated even
if the used language had attached a dialect (a concept not shared by
minted), or even when importing a LaTeX document with tex2lyx.
In some (not yet understood) situations, the paragraph metrics cache
is empty in generateSyntheticMouseEvent(). We just avoid a crash in
this case, but there is probably an underlying problem that deserves
being fixed.
Fixes bug #10324.
Both listings and minted allow for many complex options. So, a latex
source can be easily written as
\documentclass{article}
\usepackage{minted}
\usepackage{graphicx}
\usepackage{dingbat}
\begin{document}
\begin{minted}[breaklines=true,
breakautoindent=false,
breaksymbolleft=\raisebox{0.8ex}{
\small\reflectbox{\carriagereturn}},
breaksymbolindentleft=0pt,
breaksymbolsepleft=0pt,
breaksymbolright=\small\carriagereturn,
breaksymbolindentright=0pt,
breaksymbolsepright=0pt]{Python}
def f(x):
return 'Some text' + str(x) + 'some more text' + str(x) + 'even more text that goes on for a while'
\end{minted}
\end{document}
The used text editor can therefore add a mixture of tabs and spaces.
The white space after the options is not a problem and the imported
file compiles just fine, but the validator gets confused and doesn't
validate them. This would entail a difficult editing of the options
only to have them validated. So, better remove the white space.
This commit updates tex2lyx in order to also import minted listings.
For the floating version of a listing, minted uses the listing
environment, a concept that is not shared with the listings package,
towards which our listings inset is geared.
For this reason, a kludge is necessary when importing minted listings
not previously exported by LyX itself.
If the floating listing contains only a caption and a label (other
than the listing itself), everything is fine and the import is (or
aims to be) perfect. But, as in all other floating ebvironments,
one can also stick there other elements, which don't have a place
in the listings inset. So, in order to avoid a data loss, tex2lyx
sticks everything into the caption. In this way, things may be
rearranged in the GUI, if necessary. There is no other way, apart
from a complete redesign of the listings inset, of course. However,
I think that this is an acceptable compromise.
This removes the use of rectText in RenderButton. The fact that this
gave different spacing than buttonText was a problem.
Now buttonText requires to specify
* the offset, so that INSET_TO_TEXT_OFFSET is not used anymore in
src/frontends/, which will be useful later.
* the background and frame color, in replacement for the hover state.
Remove the methods button() and buttonFrame() from GuiPainter.
Remove some unused header files.
Fixes bug #10704.
If
1. the inset is deleted before pasting its contents in the outer text, and
2. the inset contents begins with an inset, and
3. the clone of this inner inset is allocated at the memory location just
made free,
then bad things can happen.
To avoid this, we delete the inset only after its contents has been pasted.
Fixes bug #10667.
This is the same issue that was addressed in the all_sel case at
695b0cc3. The rounding issue only happens at specific zoom and
jusification values.
Fixes part of #8883.
The test added at 359aef92 was incorrect. Actually, Inset::editXY
returns the inset when it is edited and also when it is not, which
can be confusing. So if we are unlucky and the slices positions in the
text area and in the inner inset match, the code below triggers and
many bad things can happen.
Also improve the documentation of Inset::editXY and TextMetrics::editXY.
Fixes#10691.
In the document settings allow to immediately switch from one
package to the other for parameters validation without the need
of first applying the changes.
Several comments in the code point to the fact that hidden buffers are assumed
to be clean.
The other solution was to adapt the closing & saving code to take into account
hidden dirty buffers. Experience shows that it is more useful to unhide the
buffers at the moment of the external modification, in the context of a git
workflow where one has to reload the modified children buffers one-by-one.
Fixes crash at #10603
When the Buffer is notified to be externally modified, check that the
file contents have changed using the checksum.
Document the shortcoming of FileMonitorBlocker.
Fixes#10642.
Starting at 61b2bd5e, boost::bind was progressively replaced with
std::bind. They are not interchangeable though. boost::bind implements
the tracking of boost::signals{,2}::trackable objects. Now that
std::bind has completely replaced boost::bind, tracking never occurred.
This commit replaces boost::signals2::trackable with the new preferred
boost::signals2 methods: scoped_connections or slot::track_foreign. The
support::Trackable class introduced is less safe but easier for transitioning
old code.
Fixes the crash at #8261.