Commit Graph

37954 Commits

Author SHA1 Message Date
Juergen Spitzmueller
cde5d60fcf Update parent buffer as soon as a child has been released
This prevents dangling pointers that might crash LyX.

Fixes: #9979.

Candidate for stable.
2017-06-17 09:43:01 +02:00
Enrico Forestieri
7a9bb85184 tex2lyx: import minted listings
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.
2017-06-17 02:23:00 +02:00
Kornel Benko
195e55d3f4 Cmake export tests: Adapt to minted listings
1.) Handle also 'LatexCommand inputminted' in lyxStatus.pm
2.) Add '-shell-escape' to the appropriate converters.
  This applies only to the ctest-environment iff calling
  the script 'prefTest.pl' in the build directory.
2017-06-16 11:39:26 +02:00
Jean-Marc Lasgouttes
62b06c64ed Use the same code for editable and non-editable buttons
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.
2017-06-15 15:40:30 +02:00
Juergen Spitzmueller
530fec453f Also catch "! Incomplete \\if" 2017-06-15 15:29:40 +02:00
Juergen Spitzmueller
39f23ac66b Catch "! Incomplete \\ifx" error
Fixes: #10666
2017-06-15 15:07:03 +02:00
Jean-Marc Lasgouttes
522516d99e Make fixIfBroken() more robust
Chop slice when its inset is not editable.

Fixes bug #10667.
2017-06-15 11:53:33 +02:00
Jean-Marc Lasgouttes
9c92494e1a Avoid memory reuse problems with inset-dissolve
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.
2017-06-15 11:53:33 +02:00
Jean-Marc Lasgouttes
939962869b Give 4 edit markers to all Frac-like insets
Part of bug #10688.
2017-06-14 15:38:47 +02:00
Jean-Marc Lasgouttes
2e84b8030e When entering an inset by cursor, reset boundary
This happesn when cursor-left/right enters an inset.

Fixes bug #10630.
2017-06-14 15:08:27 +02:00
Enrico Forestieri
e2ce2e80d7 Update it.po 2017-06-13 19:57:58 +02:00
Jean-Marc Lasgouttes
cc7917c55c Add lower corners for BOX_MARKER too
Let's see whether this helps Guillaume.

Part of bug #8883.
2017-06-13 12:18:26 +02:00
Kornel Benko
82fc30138c Update sk.po 2017-06-13 11:18:17 +02:00
Juergen Spitzmueller
3892ed8677 de.po 2017-06-13 10:09:48 +02:00
Enrico Forestieri
6e7f69c6d1 Update it.po 2017-06-13 02:34:03 +02:00
Enrico Forestieri
7fdaed0ad7 remerge po files, except sk.{po,gmo} as requested 2017-06-13 02:11:51 +02:00
Enrico Forestieri
c86f9d81e7 Avoid a crash if an external template is not installed 2017-06-12 21:24:52 +02:00
Jean-Marc Lasgouttes
5d7dae9e38 Set cursor properly after double/triple click in mathed
Without this setCurrentFont() is not correctly called on the
BufferView cursor and the cursor could appear in L-form.

Fixes bug #10686.
2017-06-12 18:02:39 +02:00
Enrico Forestieri
ae56167718 Use a combo box instead of a check box for selecting the listings package 2017-06-12 17:24:26 +02:00
Jean-Marc Lasgouttes
95c6781112 Improvements to inset edit markers
Draw also upper markers when editing macros in MACRO_EDIT_INLINE_BOX mode.

Use MARKER2 for inline editing of macros.
2017-06-12 17:09:58 +02:00
Jean-Marc Lasgouttes
f6b0ccf99c Use proper markers for display version of the math macro template.
This avoids ghost white corners when the macro does not have a display
version.

Part of bug #8883.
2017-06-12 15:15:55 +02:00
Jean-Marc Lasgouttes
71563835c7 Avoid rounding issue when painting selection
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.
2017-06-12 14:39:03 +02:00
Jean-Marc Lasgouttes
c9fefd5a2c Fix bad cursor positioning when entering an inset
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.
2017-06-12 13:51:24 +02:00
Enrico Forestieri
887445537a Switch parameters validation even before applying the changes
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.
2017-06-12 11:54:59 +02:00
Guillaume MM
5fda4e85c7 Unhide buffers that are marked dirty as a result of external modifications
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
2017-06-11 19:51:17 +02:00
Guillaume MM
fd6189b7e3 Remove FileMonitorBlocker which does not work reliably on all platforms 2017-06-11 19:51:17 +02:00
Guillaume MM
b30161b591 If the external modification is a deletion, do not ask for reloading.
The behavour when hitting "reload" on a deleted file was also confusing.
2017-06-11 19:51:17 +02:00
Guillaume MM
2058faaa3b Prevent false positives in external modifications
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.
2017-06-11 19:51:17 +02:00
Guillaume MM
db58111360 Properly track the lifetime of signals2::slots (#8261)
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.
2017-06-11 19:51:17 +02:00
Enrico Forestieri
3f61375bc3 Adjust minted options
- 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.
2017-06-11 17:51:24 +02:00
Juergen Spitzmueller
1009e44746 de.po 2017-06-11 16:42:35 +02:00
Kornel Benko
fd05261a55 Update sk.po 2017-06-11 14:51:03 +02:00
Kornel Benko
7fc170c951 Cmake build: Totally missed lokalization of lib/citeengines/*.citeengines. 2017-06-11 14:42:05 +02:00
Enrico Forestieri
570ad4219e Remerge strings again after last change 2017-06-11 14:02:02 +02:00
Enrico Forestieri
55223bdcaa Add accelerator 2017-06-11 13:58:34 +02:00
Enrico Forestieri
027cad7f96 Add documentation for minted 2017-06-11 13:42:35 +02:00
Enrico Forestieri
405d71c172 Unify translations
This entry is shared by both listings and minted, so no need to use
different strings.
2017-06-11 12:34:17 +02:00
Enrico Forestieri
6ede3c5f47 Update layouttranslations and remerge po files.
Only the new field "List of Listings" with same translation as
for "Listings[[List of Listings]]" has been added. No other change
has been done, so layouttranslations might actually change again
when automatically updated.
2017-06-11 12:24:24 +02:00
Kornel Benko
d5404136ad Update sk.po 2017-06-11 11:41:51 +02:00
Enrico Forestieri
ab47e48dcc Change the name of the "List of listings" for minted
I actually checked that minted calls "List of Listings" the list of
listings, contrarily to the listings package.
2017-06-11 10:38:44 +02:00
Guillaume MM
48a73a9e05 Make a string translatable 2017-06-11 06:01:04 +02:00
Guillaume MM
40cfede2bf Clearer message when about to discard an unsaved document entirely. 2017-06-11 06:01:04 +02:00
Enrico Forestieri
6f12fe596c Quote backspace in string 2017-06-10 23:12:49 +02:00
Enrico Forestieri
c5c480bb3c Was forgetting to add the caption to the list of listings 2017-06-10 21:00:43 +02:00
Enrico Forestieri
3dfa1cb417 Allow captions also on non-floating minted listings
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.
2017-06-10 18:43:23 +02:00
Juergen Spitzmueller
f34f0c1db4 Oops: currentData() is Qt 5 only. 2017-06-10 18:17:43 +02:00
Juergen Spitzmueller
5685080356 Correct restoration of citation style selection between engine switches
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
2017-06-10 14:29:07 +02:00
Enrico Forestieri
9913fe650d Was forgetting this at 4722e955 2017-06-10 02:43:16 +02:00
Enrico Forestieri
4722e955a8 Remove the minted external template
That functionality is now provided by the new support for minted.
Also change the example file and accordingly rename it.
2017-06-10 00:14:04 +02:00
Scott Kostyshak
98da276164 Typo in comment 2017-06-09 13:15:58 -04:00