Commit Graph

24390 Commits

Author SHA1 Message Date
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
ca2d972a36 Amend fd075614
Actually, only when using minted it is not possible to insert a
caption in a non-floating listing.
2017-06-09 12:37:05 +02:00
Jean-Marc Lasgouttes
183c97d8a8 Give a 2 pixels space for markers around math objects
This is necessary when markers are nested. Ideally this should only be
done when there is risk of nesting.

Fixes (part of?) bug #10688.
2017-06-09 11:58:26 +02:00
Enrico Forestieri
8fa0e539e5 Extend minted support to listings as child documents
This was slipping through the cracks, apparently...
2017-06-08 19:35:48 +02:00
Jean-Marc Lasgouttes
cb5464ea2b Revert "Fix drawing of collpsable insets"
This was definitely not meant to be pushed, especially since I
reverted it recently. Sorry folks.

This reverts commit 6fc72a1a1f.
2017-06-08 16:47:26 +02:00
Jean-Marc Lasgouttes
a33b633111 Revert "Fix bad cursor positioning when entering an inset"
This is not ready yet.

This reverts commit 7ca7873112.
2017-06-08 16:46:49 +02:00
Jean-Marc Lasgouttes
1538a8352c Revert "Give a 2 pixels space for markers around math objects"
This is not ready yet.

This reverts commit 5a3962958f.
2017-06-08 16:46:19 +02:00
Jean-Marc Lasgouttes
29fbd062cc Properly use top/bottom edit marker for grid inset
This was an oversight when marker() was introduced.

Fixes part of #10688.
2017-06-08 16:03:14 +02:00
Jean-Marc Lasgouttes
5a3962958f Give a 2 pixels space for markers around math objects 2017-06-08 15:22:03 +02:00
Jean-Marc Lasgouttes
7ca7873112 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.

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.
2017-06-08 13:48:51 +02:00
Jean-Marc Lasgouttes
6fc72a1a1f Fix drawing of collpsable insets
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.
2017-06-08 10:11:27 +02:00
Enrico Forestieri
3cc3ff39a0 Simplify preamble code when using listings
Following an idea from Guillame.
2017-06-08 04:25:53 +02:00
Enrico Forestieri
fd0756141c Don't allow captions in non-floating listings
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.
2017-06-07 18:15:59 +02:00
Jean-Marc Lasgouttes
48144c474b Revert "Fix drawing of collpsable insets"
This patch cuses unintended issues (see #10587).

This reverts commit 18fb9cd7f9.
2017-06-07 16:01:58 +02:00
Enrico Forestieri
aae04d25b9 Fix a small glitch
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.
2017-06-07 15:31:13 +02:00
Jean-Marc Lasgouttes
18fb9cd7f9 Fix drawing of collpsable insets
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.
2017-06-07 12:20:33 +02:00
Jean-Marc Lasgouttes
a98df58537 Fix warning about signed/unsigned 2017-06-07 11:05:29 +02:00
Jean-Marc Lasgouttes
83cd3f4293 Output default mathindent value as "default"
This is like parindent now. The old code would avoid outputing the
value when it was empty (default indentation).

Fixes bug #10657.
2017-06-07 10:53:37 +02:00
Enrico Forestieri
8dab1cfe7e Fix bug #9101
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).
2017-06-07 00:55:23 +02:00
Richard Heck
f9835d054d Fix bug #10295.
As it was, the comparison buffer was sharing a DocumentClass with
the buffer from which the document settings are taken.
2017-06-04 18:30:55 -04:00
Scott Kostyshak
b1ddae0514 Fix border when inserting column (#10538, #9306)
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.
2017-06-04 15:24:10 -04:00
Enrico Forestieri
8ae652eb16 Fix up 0cf394dd 2017-06-04 03:28:49 +02:00
Enrico Forestieri
71f532db4b Do not output a \par inside a local language switch command 2017-06-04 03:14:14 +02:00
Enrico Forestieri
55bbd67cde Fix bugs #10650 and #9598 2017-06-03 17:26:05 +02:00
Enrico Forestieri
2a5bb7ab67 Fix bug #10685
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.
2017-05-30 17:57:37 +02:00
Richard Heck
60bd141f1b Keep track of the last manually set state of the literal
checkbox in the citation dialog. Use that information to
set it appropriately for new citations.
2017-05-29 22:53:11 -04:00
Enrico Forestieri
90c423a646 Revert a gratuitous change
This commit reverts a change made at 3bc08a76 that was causing
changed output. See:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg200509.html
2017-05-29 23:22:14 +02:00
Enrico Forestieri
2dde90a8fe Revert 3ceb5034
This does not work when the footnote contains multiple paragraphs
and the font properties are changed outside the inset.
2017-05-25 19:09:50 +02:00
Guillaume MM
6d6a4d7e75 Fix coverity warning 2017-05-25 16:41:10 +02:00
Jean-Marc Lasgouttes
91f3b21e42 Take in account end of paragraph marker for inset width
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.
2017-05-24 14:05:06 +02:00
Jean-Marc Lasgouttes
b58dcff836 Let command inset honor inheritFont() on screen
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
2017-05-24 11:33:52 +02:00
Jean-Marc Lasgouttes
3f34ebbaf9 Revert "Add possibility for command inset to inherit enclosing font"
The new method was badly named, it was not supposed to override the
existing inheritFont.

Fixes bug #10682.

This reverts commit 555338048d.
2017-05-24 11:25:14 +02:00
Jean-Marc Lasgouttes
0516af0c99 Revert "InsetHyperlink: inherit font (#10677)"
This will be replaced with a better fix (see #10682).

This reverts commit c643da99d7.
2017-05-24 11:25:14 +02:00
Enrico Forestieri
3ceb503490 Fix bug #10263 2017-05-24 00:24:54 +02:00
Scott Kostyshak
c643da99d7 InsetHyperlink: inherit font (#10677)
This commit amends 55533804.
2017-05-19 05:23:28 -04:00
Enrico Forestieri
922d1ddc8c Fix bug #10469 2017-05-17 22:31:27 +02:00
Enrico Forestieri
ead148510b Amend bfe0d52e
Was forgetting to account for babel.
2017-05-16 22:02:42 +02:00
Enrico Forestieri
bfe0d52e97 Fix bug #10636
The code was not accounting for partial preview of the source code
and was trying to pop a language that was never pushed.
2017-05-16 20:20:32 +02:00
Guillaume MM
f365a65068 Fix the computation of broken InsetRef status between sibling documents 2017-05-16 12:15:27 +02:00
Guillaume MM
d7bcab5e27 Structure the broken InsetRef status 2017-05-16 12:15:27 +02:00
Guillaume MM
161f7b7f62 Improve wording (#10670) 2017-05-16 00:28:43 +02:00
Jean-Marc Lasgouttes
676ce147da Fix compilation failure 2017-05-15 10:29:09 +02:00
Jean-Marc Lasgouttes
5354c64b27 Cache QTextLayout objects with Qt/Mac
It seems that the internal Qt5 caching does not work well here,
especially in the case of Herbrew documents.
2017-05-15 10:14:42 +02:00
Guillaume MM
700225c26f Fix colours of buttons in notification frame 2017-05-15 02:28:48 +02:00
Guillaume MM
752a0a1e48 Correct debug message 2017-05-15 02:28:48 +02:00
Uwe Stöhr
0dd3311dd4 rename buffer parameter math_number_before to math_numbering_side
this is a fileformat change

also try to fix an UI issue that JMarc gets
2017-05-13 20:39:45 +02:00
Guillaume MM
1fb0a5f436 Fix computation of InsetLayout arguments for InsetText
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).
2017-05-13 16:12:25 +02:00
Guillaume MM
ef19e114bd Clean-up before following bugfix
Add helper function and factor code
2017-05-13 16:12:25 +02:00
Guillaume MM
1ac48c7cba Simplify before clean-up before following bugfix 2017-05-13 16:12:25 +02:00
Guillaume MM
c76cbead59 Cosmetic 2017-05-13 16:12:25 +02:00
Jean-Marc Lasgouttes
f1dd80f464 Proper GUI feedback for leqno option
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
2017-05-12 15:32:14 +02:00
Jean-Marc Lasgouttes
d4685f2806 Never, never use a string for something that has 3 values
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.
2017-05-12 12:00:43 +02:00
Uwe Stöhr
19cc4a1fcb GuiDocument: support also the class option reqno
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.
2017-05-12 01:06:05 +02:00
Günter Milde
ff6369d35e Fix fa0f142e (plain quotes fix).
Forgot the "break", sorry.
2017-05-11 21:41:12 +02:00
Günter Milde
fa0f142eee Fix #10583 - plain quote inset latex export in different font encodings.
Since [e68afbe671394a/lyxgit], plain quotes came out wrong if the document
contains text parts in languages setting a different font encoding.
2017-05-11 18:08:46 +02:00
Guillaume MM
5452c53e9b algorithm2e.module: Add Algorithm style to typeset algorithms
Do not output \begin and \end if there is not environment name. We only need the
nesting feature.
2017-05-10 00:03:04 +02:00
Guillaume MM
98bd27c0bf InTitle: ignore InPreamble styles for outputting \maketitle. 2017-05-09 23:38:55 +02:00
Guillaume MM
f3594cb3eb Smarter Ctrl+{Left,Right} in math.
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.
2017-05-09 23:28:32 +02:00
Uwe Stöhr
f109206c05 GuiDocument: rename a function to follow the naming guideline 2017-05-09 21:02:03 +02:00
Jean-Marc Lasgouttes
4bbcc4c563 Change ordering of function codes
Fixup e575e7ee so that func code numbers are still correct.
2017-05-09 16:28:40 +02:00
Scott Kostyshak
638020ab10 Revert "Change default working directory from ~/ to ".""
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.
2017-05-09 07:50:45 -04:00
Uwe Stöhr
902b5f368b GuiDocument: fix bug #10653
- also rename a function because we have the same function name in BufferParams
2017-05-09 01:00:36 +02:00
Uwe Stöhr
74f56e261a Color.cpp: fix bug #10656 2017-05-09 00:09:10 +02:00
Guillaume MM
1acb42911a Cosmetic 2017-05-07 14:18:17 +02:00
Daniel Ramöller
e2f864efe4 Lock toolbars (#10283)
- LFUNs to (un)lock toolbars positions (both individually and all at once)

- corresponding menu entry to "Lock Toolbars" menu.
2017-05-07 14:17:54 +02:00
Daniel Ramöller
4183a9f4dc Preferences shows current zoom instead of preference's default zoom (#10455)
- 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.
2017-05-07 14:17:54 +02:00
Daniel Ramöller
9bf8ac4432 Color Preferences: Disable colors rather than hide them (#10483) 2017-05-07 14:17:54 +02:00
Guillaume MM
dd7555af0e Fix crash with full view source (#10560 and #10617) 2017-05-07 00:07:24 +02:00
Guillaume MM
6b64d462ef Cosmetic 2017-05-07 00:07:24 +02:00
Tommaso Cucinotta
1f241dc849 Revert "Tolerate formats that are not supported by lyx2lyx."
This reverts commit 2f5396c871.
2017-05-06 09:21:58 +02:00
Tommaso Cucinotta
0fc8bd0c5f Revert "Create new graphics from within LyX choosing a sample file to copy from."
This reverts commit 7b6e26ad91.
2017-05-06 09:21:50 +02:00
Tommaso Cucinotta
7b6e26ad91 Create new graphics from within LyX choosing a sample file to copy from. 2017-05-06 00:26:00 +02:00
Tommaso Cucinotta
2f5396c871 Tolerate formats that are not supported by lyx2lyx. 2017-05-05 08:31:24 +02:00
Tommaso Cucinotta
0cf394dd79 skip graphics conversion when runparams.dryrun is true 2017-05-05 08:25:13 +02:00
Tommaso Cucinotta
cf6bbe2147 findadv: amend [8c101829/lyxgit] check that opt.find_buf_name is found in theBuffers(). 2017-05-03 17:32:31 +02:00
Tommaso Cucinotta
100a7ee22f Revert "findadv: hide word-findadv verb from the mini-buffer"
This reverts commit 8c10182962.
2017-05-03 16:37:11 +02:00
Jean-Marc Lasgouttes
a2cf919f18 Fix compiler warning (gcc 7) 2017-05-03 14:51:03 +02:00
Jean-Marc Lasgouttes
fa2dcd37a2 Show properly on screen "indented" maths.
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.
2017-05-03 14:46:05 +02:00
Jean-Marc Lasgouttes
fa146a0ffe Compilation fix 2017-05-03 09:39:30 +02:00
Tommaso Cucinotta
8c10182962 findadv: hide word-findadv verb from the mini-buffer
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.
2017-05-03 01:31:57 +02:00
Tommaso Cucinotta
3610cdf669 findadv: fix crash on wrong syntax/usage of word-findadv LFUN from mini-command. 2017-05-03 01:31:57 +02:00
Uwe Stöhr
1b016f5f67 GuiDocument.cpp: correct a name
No math numbering placement option means default. The default could be already the left side for special document classes.
2017-05-02 23:09:36 +02:00
Uwe Stöhr
8f9a08a4cb TextLayoutUi.ui: remove trace of a moved feature
fixes bug #10647
2017-05-02 23:05:30 +02:00
Scott Kostyshak
08a840b139 Warn re mixed layouts only for export (#10645)
Do not warn about mixing title layouts while editing with the code
preview pane open.

This commit amends 0b1cf133.
2017-05-01 20:08:12 -04:00
Guillaume MM
974d33ad01 Remove spurious error "QFileSystemWatcher::removePath: path is empty" 2017-05-01 19:31:42 +02:00
Juergen Spitzmueller
74c10e06aa Do not add symbols twice to Encoding::symbolsList()
Also sort the list properly.

Fixes #10644
2017-05-01 17:34:25 +02:00
Jean-Marc Lasgouttes
de990f72e1 Define new inPixels helper in BufferView
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.
2017-04-28 15:06:30 +02:00
Kornel Benko
c7a0ffc8c8 Update tex2lyx files to new format 2017-04-26 14:21:54 +02:00
Kornel Benko
8f00d7a95a To check if directory paths are identical we have to use realpath() 2017-04-26 14:20:32 +02:00
Uwe Stöhr
0ff8ec57e2 GuiDocument.cpp: change naming of formula numbering option 2017-04-26 00:32:13 +02:00
Jean-Marc Lasgouttes
91507284cb Amend b3fbe4edfd
It is better to enumerate all possibilities. Now we have a list of
special characters that do not have a tooltip.
2017-04-25 19:03:20 +02:00
Günter Milde
b3fbe4edfd Silence coverity warning. 2017-04-25 18:42:55 +02:00
Uwe Stöhr
da8b732443 Move mathindent from text layout to math settings as discussed 2017-04-25 03:01:39 +02:00
Uwe Stöhr
3f8c15a7c6 support for the document class option leqno
- fileformat change
2017-04-25 02:28:10 +02:00
Guillaume MM
62c9d0f640 Mover.h: let move be defined
We cannot use default for ~Mover() because gcc 4.6 cannot cope with it.
2017-04-24 10:53:39 +02:00
Scott Kostyshak
ee7d78d1dc Revert "Mover.h: let move be defined"
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.
2017-04-21 22:41:03 -04:00