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.
This is done by two things:
1/ the equation returns LefAlign as display() value
2/ Inset::indent() return a value (in general 0) that should be added
on the left (or right in rtl) of the inset when it is flushed.
The code that uses these values is in TextMetrics::computeRowMetrics.
The current set of options to provide include names of
the find and replace internal buffers, something out of
reach for the user. Furthermore, options are provided
using a multi-line syntax, which cannot be entered
using the mini-buffer AFAIK.
Length::inPixels(MetricsBase const &) and VSpace::inPixels(BufferView
const &) should be moved respectuvely to MetricsBase and BufferView:
core file are not supposed to use GUI files.
This reverts commit d4ea07705a.
d4ea0770 lead to a compile error with gcc 4.6. The error is likely
due to that version's weak C++11 support.
This commit reverts d4ea0770 in order to preserve compilation with
gcc 4.6 for alpha1.