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.
- Remove "chapter" and "section" as this are to be passed as class
options and are otherwise not recognized.
- Let onoff=false for all TRUEFALSE parameters, otherwise only the
form option=true is accepted and option=false does not validate,
generating a lot of confusion.
Minted provides for captions only with floating listings. However,
listings always allows captions, and our machinery is geared accordingly.
So, instead of discriminating the floating and non-floating cases,
always allow for captions with minted, too. When minted does not provide
for a caption, we will provide one.
In the child document case the caption will always be before the listing,
while for the inset case the caption will be before the listing if it
is entered as the first line, after the listing otherwise.
We stored the combo position index, but this changes on engine switch.
This also fixes a crash due to out-of-bound index at engine switch.
Fixes: #10692
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.
editXY() should probably have a documented way to indicate whether the
cursor has entered the inset, although the test used right now is
probably OK. The inset value is useful mainly for context menus or
tasks that need to know which inset the (x, y) coordinates
point to.
Note finally that the documentation of TextMetrics::editXY is
incorrect concerning the return value. It will return a non-null value
if the cursor is on a not editable inset.
Fixes#10691.
This is a follow-up to e194c9ce. There was actually no reason to let
InsetCollapsable and InsetText draw their own background. It is more
correct to remove the existing code and let the generic
Inset::drawBackground take command.
This allows to revert d207e85c.
Fixes bug #10587.
It was possible to insert a caption in a listing not marked as
floating. This didn't cause errors but the caption simply was
disappearing in the output.
When choosing a code language that has dialects in the languages
combo box, the dialects combo gets activated also when minted is
in use. However, minted does not support the concept of dialects
and the combo should not be enabled. This is harmless because the
dialects are simply ignored and the dialects status is restored
after apply, but it may fool the user in thinking that a dialect
can be actually selected. So, always disable it with minted.
This is a follow-up to e194c9ce. There was actually no reason to let
InsetCollapsable and InsetText draw their own background. It is more
correct to remove the existing code and let the generic
Inset::drawBackground take command.
This allows to revert d207e85c.
Fixes bug #10587.
Update the listings inset to optionally use the minted package
(instead of the listings one) for typesetting code listings.
Only one of the two packages can be used in a document, but it
is possible to switch packages without issues if the used options
are the same. If a switch is made and the options differ, one needs
to manually adjust them if they were entered in the advanced options
tab, or apply again the gui settings.
Note that minted requires the -shell-escape option for the latex
backend and the installation of additional software (python pygments).
When inserting a column in tabular, the border of the new column
should be copied from the border of the (previously) right-most
column.
Also remove a redundant line. The line
setRightLine(i, true);
was only reached if rightLine(i) was true.
Patch from Daniel Ramöller.
Make sure to properly nest \begin{lang} and \end{lang} tags even
when no language package is selected. In this case, LyX assumes
that babel is being used, so the language names might be wrong
if the user arranged for using polyglossia in the preamble.
Nevertheless, we assure that the produced output is syntactically
correct, so that by adding proper preamble code a correct output
is still possible.
When an inset wants to use the whole available width, it is necessary
to take into account that some of this width may already be taken by
the end-of-paragraph (pilcrow) marker.
Fixes bug #10537.
The RenderButton object now has a inherit_font_ property. It is set
depending on the value of Inset::inheritFont().
This is a better fix than 55533804, which caused bugs #10682 and #10677.
Fixes bug #10258
Do not take the optional arguments from the first paragraph, but from the
paragraphs whose layout have no arguments, consistently with the code in
InsetArgument::updateBuffer (i.e. what was shown on screen).
With these changes, equation numbers are shown properly on screen.
When setting is default, we guess the side using these two rules
* ams(art|book) and siamltex classes are leqno by default. This is
signalled because the classes provide "leqno" (in amsdefs.inc). If
there are other classes that do this in output, the relevant classes
should be updated.
* the language arabic_arabi also sets leqno by default. This is
currently hardcoded for lack of a better idea.
Besides, a few bugs are fixed:
* use mathrm instead of mathbf for numbers metrics
* set spacing between maths and labels in inches
This commit replaces the string math_number_before by a proper math_number enum.
Note that the _before naming was misleading. It was chosen at a time
when we were not sure whether leqno was always left or could be right
in RtL documents.
Note that the token in LyX document is still \math_number_before and
this should be changed.
Fixup for 19cc4a1f.
as discussed our support for the formula numbering side should be complete. There are document classes that uses left numbering as default and with the class option "reqno" this can be changed to right numbering. reqno requires the loading of amsamth.
Consider mathbin, mathrel and mathpunct as word separators. This makes
Ctrl+{Left,Right} more intuitive, quicker, and more different from {Left,Right}.
This takes into account all the feedback from the discussion on the general
list. Further feedback welcome.
Setting the default working directory to '.' is an invasive change
on Mac and Windows, where the current working directory of LyX when
LyX is started from the GUI is not a reasonable choice for the
default directory in e.g. the "save as" file dialog or the "open"
dialog. A similar situation could happen on Linux distributions (I'm
not aware of any, e.g., POSIX standard that defines that the working
directory of a binary started from GUI should be the home
directory). Thus, it is not clear this default is good on any
platform.
If the user wishes to have the behavior of '.', the description in
the "paths" preferences pane provides the information for making the
change.
For more information, see the discussion at:
https://www.mail-archive.com/search?l=mid&q=635298DE-5028-4BB1-8D8F-A634BA68C420%40gmx.net
This reverts commit 892593fbdc.
- Adds a currentZoom variable which holds the current zoom level.
- The zoom stored in preferences is used as default zoom level (default binding:
M+0).
- The currentZoom is saved and restored via QSettings.
- Adds LFUN buffer-zoom for (re)setting zoom.