Commit Graph

26250 Commits

Author SHA1 Message Date
Juergen Spitzmueller
d876319e85 \detokenize paths containing ~ 2019-07-07 10:32:06 +02:00
Richard Kimberly Heck
f17e868e65 Whitespace 2019-07-06 15:19:51 -04:00
Richard Kimberly Heck
45f0fae10c Fix some nullptr warnings. 2019-07-06 15:16:02 -04:00
Juergen Spitzmueller
bf6a7dc38f Fix nomencl generation with LuaTeX
Fixes: #11571
2019-07-06 15:15:06 +02:00
Jean-Marc Lasgouttes
5a22b2e391 Fixup 17571104: really avoid empty numbers in toc
For some reason, I missed this one when trying to fix the bug.

Fixes bug #11423.
2019-07-01 12:05:31 +02:00
Jean-Marc Lasgouttes
455f10eae7 Revert "backing store"
This is not ready yet.

This reverts commit 1a2b1a3bfa.
2019-07-01 10:38:16 +02:00
Juergen Spitzmueller
6c7c6e580f tex2lyx: add general TODO item 2019-06-30 16:14:24 +02:00
Juergen Spitzmueller
bda3b6d07e [2.3 cand.] Fix import of custom float definitions
Candidate for stable
2019-06-30 11:13:20 +02:00
Juergen Spitzmueller
63492d4efa Cleanup TODO 2019-06-30 10:58:49 +02:00
Jean-Marc Lasgouttes
e485102ef2 For python 3 require at least 3.5
This handles configure.ac and os::python23. What remains to be done is cmake.
2019-06-28 00:06:28 +02:00
Juergen Spitzmueller
cd5c406d9a More localization fixes 2019-06-26 12:25:53 +02:00
Juergen Spitzmueller
c703f76fe1 legacy > traditional 2019-06-26 11:14:59 +02:00
Juergen Spitzmueller
a62c4252ab Flag GUI strings for translation
Still room for improvement
2019-06-26 11:04:56 +02:00
Juergen Spitzmueller
0a8294d426 Improve encoding GUI string 2019-06-26 08:57:05 +02:00
Jean-Marc Lasgouttes
1a2b1a3bfa backing store 2019-06-25 12:39:32 +02:00
Isaac Oscar Gariano
4c587fb9da Make autocorrect have priority.
Place autocorrect at the top of `InsetMathNest::interpretChar`,
ensuring that any autocorrections that trigger on special characters
(such as '^' or '~') work. In particular, you can now make an
autocorrection from "<~" to "\preceq"!
2019-06-25 12:27:28 +02:00
Juergen Spitzmueller
5cef539e8b update tex2lyx tests 2019-06-23 13:05:38 +02:00
Juergen Spitzmueller
94654b3586 Linguistics: add support for Discourse Representation Structures
File format change
2019-06-23 12:59:56 +02:00
Juergen Spitzmueller
57788b8719 Fix tooltip 2019-06-22 08:35:14 +02:00
Günter Milde
71a57e0f4d Preserve \inputencoding value when switching to non-TeX fonts.
With non-TeX fonts, the \inputencoding setting is overridden
by "utf8-plain" (pass-through). Keeping the old value allows
switching back to TeX fonts without the need to (re)set
the input encoding.

Also change back the GUI name of the "auto-legacy" setting
(cf. #11115).
2019-06-21 12:40:41 +02:00
Jean-Marc Lasgouttes
938463b5d6 Fixup 3dc54d4a: fix string encoding issues with Qt4
The culprit here is the constructor QString(QByteArray const &): in
Qt4, it would interpret the byte array as latin1, and in Qt5 as utf8.

Therefore it is safer to use explicitly QString::fromUtf8 instead of
this constructor.

Several places where additionally simplified, in order to avoid some
extra conversions.
2019-06-20 11:27:15 +02:00
Jean-Marc Lasgouttes
3a7142d9bf Fix compilation with Qt4 2019-06-20 10:48:59 +02:00
Günter Milde
5fe6bc616c Fix order of Unicode encodings in Settings combobox.
Ensure the default encoding "utf8" comes always first,
followed by other common variants.
The encodings were sorted based on the GUI name which leads to
the default setting moving from the top position in some localizations.
2019-06-19 21:09:16 +02:00
Günter Milde
53500242f9 Harmonize input encoding selection widgets.
See #11115.
2019-06-18 15:43:34 +02:00
Jean-Marc Lasgouttes
5249eaaa60 Use <cstdint> instead of <boost/cstdint.hpp>
This is mandated by C++11.
2019-06-17 16:19:31 +02:00
Jean-Marc Lasgouttes
fbe0caa483 Do not use BOOST_CURRENT_FUNCTION
There is no need to use that, since __func__ is standard in C++11.

Anyway, this code is unused unless one defines USE__func__ to something.
2019-06-17 15:57:03 +02:00
Jean-Marc Lasgouttes
2b1515a936 Rename LM_ST_* to *_STYLE and FONT_SIZE_* to *_SIZE
This makes code more uniform. This is typically something that is done
at end of cycle to limit backport issues later.
2019-06-14 17:05:49 +02:00
Jean-Marc Lasgouttes
f12e796999 Revert "Rename LM_TC_* to FONT_STYLE_*"
Got it wrong, revert for now.

This reverts commit 67215833a1.
2019-06-14 17:05:00 +02:00
Jean-Marc Lasgouttes
67215833a1 Rename LM_TC_* to FONT_STYLE_*
This makes code more uniform. This is typically something that is done
at end of cycle to limit backport issues later.
2019-06-14 16:42:02 +02:00
Jean-Marc Lasgouttes
134f3aedaf Avoid warnings with gcc 9
The warning about unneeded std::move can be solved by conditioning on
C++14 mode.

The warnings about deprecated copy is harder, so we disable it for
now. We will be able to fix our part, but Qt triggers it a lot too.
2019-06-12 18:49:29 +02:00
Jean-Marc Lasgouttes
5173f22024 Fix some warnings found by the -Wall options of autoconf and automake.
There are still warnings to address. For now, they not enabled by default.
2019-06-12 18:00:18 +02:00
Jean-Marc Lasgouttes
22f599250e Remove support for gcc 4.6
This was kept so long because of Ubuntu 12.04 LTS, but having a
not-really-c++11 compiler is not nice.
2019-06-12 15:03:18 +02:00
Günter Milde
c627507b3f Revert 051de65db and implement alternative fix for remainder of #11115. 2019-06-12 11:48:47 +02:00
Richard Kimberly Heck
acd0f2fc78 Do not show both 'hide' and 'close' options on tabs for child buffers.
We can only close it (as opposed to hide it) if it's not a child.
Part of #11331.
2019-06-10 16:47:16 -04:00
Enrico Forestieri
1cb2a443b5 Fix bug #11595
Avoid an endless loop when in the definition of a macro the macro
itself is used in the LyX representation part.
2019-06-09 22:36:59 +02:00
José Matos
ad96fd835b Divide the python detection in three functions, with a clear delegation of responsibilities
python23_call: determines if the binary given is appropriate and adds the necessary calling options

find_python_binary: get a list of candidates and choose the right one using python23_call

python: returns the name of the python interpreter that can be found on PATH, using find_python_binary
2019-06-08 12:49:30 +01:00
José Matos
02ee471d9d Move python related functions together to make it easy to read the code. 2019-06-08 12:22:26 +01:00
José Matos
35c299f86d Remove alternative operator representations (and,or) and improve comments for python binary detection. 2019-06-08 09:15:03 +01:00
Jean-Marc Lasgouttes
41c0fc171a Revert "Remove unneeded std::move"
This confuses gcc 4.9

This reverts commit 44e88a4c13.
2019-06-07 19:41:16 +02:00
Pavel Sanda
bf99ece736 Start reporting missing citations and broken references in LaTeX build.
Now we report these in the same way as LaTeX errors (but let the user to
see the result anyway). It remains to be shown much is this disturbing
to users. Generally, ignoring these is not a good idea, because they are
harder to manually spot in longer documents.

The details of reported error varies because log linebreaks at 90
induced by pdflatex make log harder to parse.
The committed code is more robust than previous, in which some missing
cits/refs with long keys would go unnoticed.

Tested on bibtex and natbib.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg208912.html
2019-06-07 16:47:04 +02:00
José Matos
adb779a692 Change python run time detection to privilege python 3 over python 2.
This should work as before but now we also control the python version and ignore it if it is not in the supported range.
2019-06-07 15:27:25 +01:00
Jean-Marc Lasgouttes
44e88a4c13 Remove unneeded std::move
Signalled by gcc 9.
2019-06-06 15:23:42 +02:00
Jean-Marc Lasgouttes
b8b5ed8b31 Clean up Language.cpp
Use range-base for loops everywhere.

Rename languagelist to languagelist_, since it is private.
2019-06-05 16:28:37 +02:00
Jean-Marc Lasgouttes
bf88ad495c Make Word Wrap property confiurable by language
It is now possible to specify in the lib/language file whether screen
rows can be broken anywhere (CJK languages) or only at work boundary.

Set WordWrap to false for the CJK languages (notice that japanese-cjk
had been forgotten before).

Moreover, remove a test for separators in row element that was not
really helpful.

Fixes part of ticket #10299.
2019-06-05 15:50:53 +02:00
Günter Milde
051de65db9 Fix remainder of #11115.
Implement GUI suggestions from
https://www.lyx.org/trac/ticket/11115#comment:26
2019-06-05 11:18:36 +02:00
Juergen Spitzmueller
2f648cc17a small correction 2019-06-04 11:10:54 +02:00
Juergen Spitzmueller
e2f81b3a84 Rework linguistic gloss support
This now uses the new and enhanced \digloss ad \trigloss macros of
convington 2.0 rather than the deficient self-baked ones.

File format change.
2019-06-04 11:01:19 +02:00
Günter Milde
b2cee3dcc5 Support more languages (file format change).
Format incremented to 576:
Support for the document languages azerbaijani, bengali,
churchslavonic, and oldrussian.
2019-06-03 16:58:10 +02:00
Jean-Marc Lasgouttes
d02244c8fb Make caret visible inside math macros arguments
The first step is to move the MathRow cache to BufferView, alongside
coordCache. This was on the todo list anyway, since it allows to let
go the math row information when the math equation is not on the
screen anymore. With the old scheme, it would always remain in memory.

Then, when computing caret size in MathData::metrics, make sure that
the mathrow of the elements that are linearized in the MathRow object
get their caret size information initialized too.

Fixes bug #11587.
2019-06-03 16:28:16 +02:00
Juergen Spitzmueller
18ebcab403 Properly reset lineno_opts 2019-06-03 14:33:08 +02:00
Isaac
3519be2292 Removed shortcuts to toggle autocorrect.
They are not really needed now that autocorrection can be undone. This
increases autocorrect usability.
2019-06-03 11:09:09 +02:00
Jean-Marc Lasgouttes
64396717db Allow to undo partly math autocorrect
To this end, introduce Undo::splitUndoGroup, which ends currently
group and creates a new one with same nesting level.
2019-06-02 21:17:26 +02:00
Isaac
bed546d6f6 Make math autocorrrect work with more than 2 chars
Currently, math autocorrect allows to transform a couple of characters
to a new one. This patch allows to transform a couple (sequence,
character) to a new character.

No example are implemented right now. One possible idea would be
"--" + ">" => \longrightarrow
2019-06-02 21:12:12 +02:00
Juergen Spitzmueller
d2b6232ce7 Fix lineno options param
This has been written even if empty -- and thus caused reading errors.
2019-06-02 19:07:01 +02:00
Juergen Spitzmueller
c7efb677f8 New InsetLayout tag ParbreakIgnored
This effectively allow paragraph breaks in insets only for cosmetic
reasons (e.g., to align contents on different lines).

This is the last change necessary for an enhanced covington gloss support
(which uses the new covington gloss ui)
2019-06-02 18:16:30 +02:00
Juergen Spitzmueller
9e6d22ea9c Add InsertOnNewline argument tag
This adds a paragraph break before auto-inserting arguments in flex
insets.

Useful for specific arguments (particularly ling glosses)
2019-06-02 18:07:10 +02:00
Juergen Spitzmueller
cb6c183225 Amend 9f04eeae03 2019-06-02 16:55:11 +02:00
Juergen Spitzmueller
9f04eeae03 Support FreeSpacing in InsetArgument 2019-06-02 16:33:06 +02:00
Juergen Spitzmueller
378c7e8edb Allow for auto-inserting multiple arguments 2019-06-02 09:26:32 +02:00
Juergen Spitzmueller
532765c03a Enable AutoInsert with post arguments 2019-06-02 09:25:56 +02:00
Kornel Benko
58804aa399 Omit floating point exception 2019-05-31 12:55:12 +02:00
Juergen Spitzmueller
fe589d5622 Fix toprule with booktabs/longtable and captions 2019-05-31 10:48:00 +02:00
Richard Kimberly Heck
91383e1fec Forgot this part 2019-05-30 20:39:43 -04:00
Richard Kimberly Heck
2e433654c7 Fix bug #11588.
Check for the local file before calling kpsewhich.
2019-05-30 20:32:35 -04:00
Richard Kimberly Heck
0d54d3b762 Allow click on the 'spinner' to cancel export. 2019-05-27 23:21:07 -04:00
Richard Kimberly Heck
c4658f046f Fix crash reported by Kornel.
See https://marc.info/?l=lyx-devel&m=155879185229073&w=2.

The problem is that, after saving the document and reloading, the
TOC is corrupted, more or less, when we run through updateBuffer.
So we reset it first.
2019-05-27 22:35:02 -04:00
Enrico Forestieri
b3db2325ed Prefer mathmode commands over textmode ones
Translating → to \rightarrow in a \ce inset produces the right
glyph. Instead, translating it to \textrightarrow produces a
different glyph (β).
2019-05-26 13:06:44 +02:00
Enrico Forestieri
c8f056417f Use ranges 2019-05-26 12:31:02 +02:00
Enrico Forestieri
15f4fa452d Supplement the fix for bug #11586
The mhchem \ce inset is a text mode environment but allows entering
spaces and mathmode commands. However, even if it doesn't allow unicode
symbols, LyX allows entering them (by copy/paste, for example), causing
latex errors. As a unicode symbol may have a proper latex representation
from the unicodesymbols file, use it instead of the bare symbol. Here, we
don't care about the mode because both text and math mode should be allowed.
For example, the ⟶ symbol is not recognized but its latex representation
(\longrightarrow) is fine. Of course, there may be symbols that are
not recognized anyway, but this is better because they cause explicit
errors from mhchem instead of cryptic iconv errors in case they cannot
be represented in the document encoding.
2019-05-26 09:56:34 +02:00
Enrico Forestieri
bda3b799c5 Partial fix for bug #11586
Do not replace a latex command with the corresponding symbol
in the unicodesymbols file unless it can be encoded in the
document encoding.
2019-05-26 09:27:46 +02:00
Günter Milde
c83765163f CJK package is never used with non-TeX fonts.
Prepare for languages that use CJK with TeX fonts and Polyglossia
with non-TeX fonts.

Korean is already supported by Polyglossia,
LyX support will follow (file version change).
2019-05-26 01:45:35 +02:00
Günter Milde
45c5b39692 Adapt lyx2lyx to the lineno support fix in [88f471899/lyxgit]. 2019-05-25 15:32:24 +02:00
Günter Milde
d1b89c59d4 Remove non-required ternary conditional.
In a branch only entered when not using Xe- or LuaTeX,
we don't need to care about polyglossia.
2019-05-25 15:32:24 +02:00
Jean-Marc Lasgouttes
4da19ef833 Cell in delimiter inset should not be tight
Fixes bug #11337.
2019-05-25 14:11:39 +02:00
Kornel Benko
ef6ddfc788 Amend 7f125f62d2, Introduce doc preference for line numbering
Correct expected lyx files created by tex2lyx.
2019-05-24 18:17:50 +02:00
Juergen Spitzmueller
1cafea7cf7 Read line edit label
Otherwise it is not clear what this means.
2019-05-24 17:51:42 +02:00
Juergen Spitzmueller
b6cb557c7d size tweak 2019-05-24 17:39:22 +02:00
Pavel Sanda
bea2756472 lineno: dump lineno buffer token if false/empty as well.
Oversmarted myself. Wanted to save .lyx header from overbloating but
dialog's UI depends on those tokens when disabling the option in UI.
2019-05-24 15:50:10 +02:00
Pavel Sanda
88f4718996 lineno: convert ui GB to CB per Juergen's request 2019-05-24 15:40:09 +02:00
Juergen Spitzmueller
03d9fe3a80 Some grammar and casing fixes and tooltip improvements 2019-05-24 10:59:00 +02:00
Pavel Sanda
7f125f62d2 Introduce doc preference for line numbering.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg208781.html
2019-05-23 15:13:27 +02:00
Pavel Sanda
e3707f1331 Resave NumberingUi.ui in qt5 designer 2019-05-23 15:11:39 +02:00
Jean-Marc Lasgouttes
621c908f85 Always paint text decoration when painting inset.
Fixes bug #11402.
2019-05-23 11:30:35 +02:00
Jean-Marc Lasgouttes
7cc4ceb89c Fixup da2696cc: do not clear useful information from row
Ensure before calling breakRow that the row is empty.

Remove Row::clear(), which has unnatural semantics.

Fixes bug #11396.
2019-05-23 10:26:08 +02:00
Richard Kimberly Heck
596b3c4522 Include all parent branches in the menu.
Previously, we only included branches from the master document. This
includes those from the parent, grandparent, etc, and does so in a way
that won't crash on recursive includes.
2019-05-22 22:00:31 -04:00
Richard Kimberly Heck
1842a11b3b Change how branches are displayed on the menus.
Show this document's branches first in the menu, and then show the
master document's branches on a sub-menu.
2019-05-22 21:41:22 -04:00
Richard Kimberly Heck
24fefaf23d Use ranges. 2019-05-22 21:41:22 -04:00
Richard Kimberly Heck
5fa493aa4a Re-organize and comment code a bit. 2019-05-22 20:58:00 -04:00
Jean-Marc Lasgouttes
da2696cc63 Initialize row preperly on clear()
It is not enough to get rid of the row elements, obviously. In
particular, changebar_ may never get reset.

Fixes bug #11396.
2019-05-22 11:56:14 +02:00
Juergen Spitzmueller
957e8669c7 Add hint to warning. 2019-05-21 13:26:57 +02:00
Juergen Spitzmueller
c77be6146b Fix warning message 2019-05-21 13:06:37 +02:00
Juergen Spitzmueller
ebc2b1295a Check character encodability with pass-thru in command insets
Fixes: #11584
2019-05-21 12:59:18 +02:00
Richard Kimberly Heck
714241c313 Inform user of the new name of the emergency file. 2019-05-20 21:23:40 -04:00
Enrico Forestieri
2424851b09 Fix compilation
This amends [b88a3747/lyxgit].
2019-05-19 16:34:57 +02:00
Enrico Forestieri
b88a37473f Remove redundant condition
The removed condition is always true.
This amends [61efbff5/lyxgit].
2019-05-19 12:33:46 +02:00
Enrico Forestieri
61efbff545 Fix bug #10498
Use the selection as the argument of a macro also when the
macro has only optional arguments.
2019-05-18 16:06:33 +02:00
Enrico Forestieri
1a286c7910 Fix bug #10499
The array environment has to be explicitly parsed in math mode.
2019-05-18 11:36:07 +02:00
Günter Milde
65ec404eb3 Format incremented to 574: Ruby inset, fixes for Japanese.
New auxiliary functions for lyx2lyx:
del_module(), append_local_layout(), del_local_layout()
2019-05-16 13:48:07 +02:00
Jean-Marc Lasgouttes
26c2811cc4 Some Asian langagues allow to wrap text at any position
This is hardcoded for now for simplicity and to allow backporting to
2.3.

The behavior is unchanged for all languages but Chinese, Japanese or
Korean.

Fixes part of bug #10299.
2019-05-15 17:38:26 +02:00
Günter Milde
6aabcaf856 Fix #11062, new LaTeX feature "textschwa".
Following the suggestion in the Babel-Azerbaijani documentation,
we use the glyphs from the Cyrillic fonts for the Latin
text character. This fits better than IPA fonts (assuming there are matching
Latin and Cyrillic fonts specified) and also provides bold etc.
2019-05-14 20:08:39 +02:00
Günter Milde
06ae6e118c Fix small typo. 2019-05-14 16:39:35 +02:00
Günter Milde
177ae5a358 Add comment (fixme) about #8479. 2019-05-14 15:31:41 +02:00
Juergen Spitzmueller
3da25187a9 Prevent assert due to some odd role in older qt versions. 2019-05-14 14:05:46 +02:00
Jean-Marc Lasgouttes
6df593049c Revert "Try to compute row height like it should be done"
This is not done right at all. The best is to revert for now and
think about how to do it properly.

This reverts commit 66a3d64346.
2019-05-13 10:47:47 +02:00
Richard Kimberly Heck
051a1a56a9 Revert "GMO for BG"
This reverts commit 5b84f11f80.
2019-05-12 23:30:49 -04:00
Richard Kimberly Heck
5b84f11f80 GMO for BG 2019-05-12 23:30:13 -04:00
Richard Kimberly Heck
15b90e4cc1 Rename for clarity. 2019-05-12 23:16:25 -04:00
Juergen Spitzmueller
682eabbe8e GuiDocument: Further encoding GUI improvement
Move the odd "(no inputenc)" option out of the encoding list.
2019-05-12 09:10:24 +02:00
Jean-Marc Lasgouttes
175711046d Newly created inline math is not numbered
The bad initialisation created phantom entries in equation ToC

Fixes bug #11423.
2019-05-11 23:18:10 +02:00
Juergen Spitzmueller
e94239e973 Correct entry string 2019-05-11 19:04:36 +02:00
Juergen Spitzmueller
62085642bc Fix indentation 2019-05-11 18:59:42 +02:00
Juergen Spitzmueller
79feeb0c03 Micro-typographic fix 2019-05-11 12:17:09 +02:00
Juergen Spitzmueller
83a62a6d74 Further encoding GUI improvements 2019-05-11 12:16:52 +02:00
Juergen Spitzmueller
a6116428c0 GuiDocument: Adapt to new encoding default
Also simplify the code.
2019-05-11 11:28:21 +02:00
Jean-Marc Lasgouttes
4cbf8c2f9d add unicode descriptions to InsetSpecialChar code 2019-05-10 14:29:24 +02:00
Jean-Marc Lasgouttes
3a7346b0cb Fixup 12fcaf86: use correct font for metrics of logos 2019-05-10 12:29:23 +02:00
Jean-Marc Lasgouttes
c3f10df95d Move the stateText code for FontInfo to FontInfo class.
The first parameter of Font::stateText is now optional.
2019-05-10 10:45:40 +02:00
Enrico Forestieri
56a14c3fde Refined fix for #9633
A branch inset modifies the layout of the internal structures in
which the text is organized. When a branch is active, it is as if it
was not there, but its only presence makes a paragraph which would not
be the last one to actually be the last one, or the check for the
language of the previous paragraph to fail because there is no
previous paragraph before the first one in a branch inset.
Oney way I found to tackle it, is tracking whether the typesetted
paragraphs are actually part of an active branch inset and acting
accordingly.
2019-05-10 08:09:26 +02:00
Günter Milde
6319b0c303 Do not default/fall back to input encoding setting "auto-legacy".
Use "utf8" instead. "utf8" works now with all supported languages.
2019-05-09 21:57:05 +02:00
Günter Milde
40240ef6a0 Improve error message and ctests for input encoding cp858.
Encoding cp858 supported by only some iconv variants.
Most users will want to change their "encoding" setting instead
of installing/recompiling "iconv" to support this legacy encoding.

ctests are likely will fail with either "vanilla" or "enhanced"
iconv and test a situation that is unlikely to change generally,
so we ignore this test now by default.
2019-05-09 09:28:37 +02:00
Günter Milde
af9838fd32 Fix spurious \end{CJK} in LaTeX output. 2019-05-07 23:37:30 +02:00
Günter Milde
46119b3564 Make Japanese documentation more robust.
The locally defined Ruby (furigana) inset now
works also with non-TeX fonts.
2019-05-07 16:16:35 +02:00
Jean-Marc Lasgouttes
12fcaf8652 Compute metrics of *TeX* logos using draw and a null painter
Instead of writing a metrics() method that mimics what draw() does,
re-use the draw code with a null painter.

This has the additional benefit of fixing InsetSpecialChar logo width
with EB Garamond. I have to admit that I do not know why it was too
large with the old code, but the new code is shorter/better anyway.

This code removes logowidth(). metrics() is moved to a different
place, but only the logo cases are touched.
2019-05-07 10:53:02 +02:00
Günter Milde
8e88d100f1 "unicode=true" leads to errors for Japanese with "platex" even when using utf8-encoded latex source.
The bxjsbook class raises an error if seeing this option
(before TL19 only a warning). Other document classes just ignore
it and PDF-bookmarks are wrongly encoded in any case.
2019-05-06 08:52:24 +02:00
Günter Milde
337e3ff9a6 Fix Font selector GUI (font encoding) broken in 27ba6f282d. 2019-04-30 09:34:51 +02:00
Günter Milde
7a87599a3e Load inputenc after babel with Thai.
"thai.ldf" breaks "inputenc" by changing catcodes.
Loading "inputenc" after "babel" allows a workaround.
2019-04-27 17:09:29 +02:00
Günter Milde
c349472d35 "AsBabelOptions" no longer required. Part2.
AsBabelOptions was introduced 2010 in [cc5dd37a2a05/lyxgit].

Since the re-orgianization and opening of the Babel package to
"contributed" language definitions in March 2013, it is no longer required.

Clean up after Part 1 [1361f1a45f23/lyxgit].
2019-04-27 17:09:29 +02:00
Enrico Forestieri
d5567ac36f Compile fix for mingw
This was probably overlooked at [7bb08f10/lyxgit].
2019-04-27 12:53:05 +02:00
Richard Kimberly Heck
c286228315 Make Ctrl-Mouse open an included file for editing.
It might be nice to do this also for other insets that allow editing.
To do that properly, we'd want to standardize how such insets call an
external (or internal) program, which I guess would mean a virtual
method corresponding to editIncluded. When it exists (i.e., isn't null),
then we could call it, and we'd only need one centralized method to do
that. But at the moment, we have editGraphics, etc.
2019-04-26 22:05:42 -04:00
Richard Kimberly Heck
276ffc262c Simplify a bit.
Also, I always worry that "file" will conflict with something....
2019-04-26 22:05:42 -04:00
Günter Milde
e84f6dff77 Fixes for Japanese documents
PDF outline improves with unicode/utf8 (although some chars still wrong).

Math: ERT for umlauts no longer required (now force-converted with unicodesymbols)
2019-04-26 23:02:44 +02:00
Kornel Benko
4e7cbe8b34 Cmate tests: Add citenegine-modules to tests 2019-04-26 16:55:30 +02:00
Enrico Forestieri
2731c5dc55 Correctly protect macros with optionals inserted in an optional argument
The trick turns out to be inserting in braces the whole optional
argument, rather than the single macro.

See #11552 for the long history.
2019-04-26 15:30:08 +02:00
Enrico Forestieri
e763f90244 Revert [60ac25a4/lyxgit], [30f16463/lyxgit], and part of [e8f480e7/lyxgit]
As evidenced in #11552, at loading time there is no way to tell
whether braces were added by LyX with certainty. However, after
[503f7db2/lyxgit], LyX does not automatically removes brace insets.
So, in case one faces the problems mentioned in [e8f480e7/lyxgit],
the workaround of adding a brace inset now will not be frustrated.
In essence, after [503f7db2/lyxgit], the real fix for #11552 would
have been reverting the part in [e8f480e7/lyxgit] that was adding
the braces on output.
2019-04-26 12:34:29 +02:00
Enrico Forestieri
30f1646369 Write braces around macros only when actually needed
When a macro with optionals appeared inside the optional argument of
another one, the onscreen display and latex output were wrong. This
issue was addressed at [e8f480e7/lyxgit] by enclosing in braces macros
with optional arguments. However, this was done even when the macro
with optionals was in a non-optional argument of another macro.
This commit limits the bracing to the cases where it is really needed
and allows to address some particular issues evidenced in #11552.
2019-04-25 11:11:51 +02:00
Enrico Forestieri
60ac25a435 Yet another attempt at properly fixing #11552
This commit supercedes [54147a71/lyxgit] and [acba8476/lyxgit].
2019-04-24 17:28:53 +02:00
Jean-Marc Lasgouttes
ddb51c721c Do not redefine LyXAlignment; reformat a bit 2019-04-24 16:28:08 +02:00
Jean-Marc Lasgouttes
26817e9347 remove dummy LyXRC class that was forgotten 2019-04-24 14:54:49 +02:00
Kornel Benko
ef285cb7c4 Amend 7d021a93: Use interprocedural optimization if possible
Discard test programs using dummy_fuctions from the optimization.
This omits warnings about multiple method definitions.
2019-04-24 14:47:44 +02:00
Enrico Forestieri
acba847649 Amend [54147a71/lyxgit]
If none of the optional arguments of a macro is used, there is no
following '[' after the macro name. Unfortunately, at loading time
the macro machinery is still not initialized, so the optionals()
member of InsetMathMacro is unusable. Hence, we have to track the
creation of macros with optionals as already we do for all macros.
The collected information is only used at loading time, because
the macros are dynamic and they may loose or acquire optional args.

Fixes the particular case reported at #11552.
2019-04-23 21:06:12 +02:00
Juergen Spitzmueller
b77094a497 Only write btUnits if we have a bibliography
Fixes: #11562
2019-04-23 08:58:01 +02:00
Juergen Spitzmueller
89f6de9835 Append rows and columns if necessary when pasting into table 2019-04-23 08:34:53 +02:00
Juergen Spitzmueller
302796ade1 Amend cf1c506d64
Get direct copying fro LibreOffice working
2019-04-22 11:10:07 +02:00
Juergen Spitzmueller
cf1c506d64 Handle plain text/html rows/columns in tabular LFUN_PASTE
Fixes: #7932
2019-04-22 10:56:00 +02:00
Juergen Spitzmueller
c9432ccbbc \cprotect some content in captions
Fixes: #6243
2019-04-21 16:44:29 +02:00
Juergen Spitzmueller
3663f9d0db Some more 0 > nullptr substitutions 2019-04-21 15:49:11 +02:00
Juergen Spitzmueller
96e4001d01 Handle orphaned bibitems
Fixes #7160
2019-04-21 11:17:44 +02:00
Juergen Spitzmueller
faefee3dc6 Fix renaming of citation refs after changing bibitem key
Fixes: #6494
2019-04-21 09:55:17 +02:00
Juergen Spitzmueller
0a4686d8d3 update buffer after fixBiblio
fixes: #2743
2019-04-20 19:53:24 +02:00
Juergen Spitzmueller
9370135c3e reset bibitem counter in the second updateBuffer() routine as well
Fixes: #8499
2019-04-20 19:42:29 +02:00
Juergen Spitzmueller
4f884fc92d Pass proper text to TeXOnePar in Paragrapgh::Private::validate
This fixes InPreamble layouts in insets (#11557)
2019-04-20 17:51:06 +02:00
Juergen Spitzmueller
e325c7cc6a GuiIdListModel: ignore DecorationRole (icons of available list) 2019-04-20 17:50:21 +02:00
Juergen Spitzmueller
b60259fbe1 Add system/local icon to available modules list
Also markup modules with missing requirements (like we do for layouts)
2019-04-20 09:28:46 +02:00
Juergen Spitzmueller
c0f734bcef Fix some listings/minted incompatibilities
The basic problem here is that rather than using an abstract syntax,
backend-specific param strings are produced in the listings dialog,
depending on whether listings or minted is used.

Of course this breaks if a user switches backends inbetween (s/he would
have to open and re-apply each and every listings inset!)

Do at least the most basic translations in InsetListings::latex().
A sane solution would imply the use of only one param syntax with
respective interpretation for each backend. But this would be a file
format change.
2019-04-19 19:03:29 +02:00
Enrico Forestieri
54147a7140 Fix #11552 in a different way
The reported issue is fixed in a different way, not
involving the fix for #9348.

This commit supercedes [f2029fb3/lyxgit] and [17abf68b/lyxgit].
2019-04-19 18:28:42 +02:00
Juergen Spitzmueller
3e516a6219 Use proper listings font styles with polyglossia and RTL
Fixes: #11554

Also load color with minted and polyglossia/RTL, as minted loads it
too late.
2019-04-19 17:18:18 +02:00
Kornel Benko
fe4a5c3bc9 Amend 7bb08f10 2019-04-19 15:40:58 +02:00
Jean-Marc Lasgouttes
7bb08f10b1 Move initial values of LyXRC members to the header
We use a C++11 construct that puts initial values of members along
with their definition. It is a good construct and now the out of line
constructor and the setDefaults() method can go.

This removes the need to define a dummy constructor in tex2lyx and
client.

The only needed change to the rest of code is a change of signature
for the user_(name|email) to return std::string. They are now called
explicitely from the constructor. We now have to include userinfo.h in
LyXRC.h, but this should not be too expensive.
2019-04-19 14:46:12 +02:00
Juergen Spitzmueller
499167b2c5 Another quotation mark fix. 2019-04-19 14:27:27 +02:00
Juergen Spitzmueller
ac84510453 Fix quotation marks in GUI string. 2019-04-19 13:43:33 +02:00
Juergen Spitzmueller
2fa68abd00 Layout tweaking 2019-04-19 11:27:54 +02:00
Juergen Spitzmueller
7cadacb19b The Author(Year) label format is also mandatory for numeric natbib! 2019-04-19 09:53:42 +02:00
Juergen Spitzmueller
e97546c9a8 More formalia
(this are just things QtCreator nags about, and I address them in passing)
2019-04-19 09:34:12 +02:00
Juergen Spitzmueller
bebc184054 Display full author list with Natbib (non-BibTeX) if requested 2019-04-19 09:33:31 +02:00
Juergen Spitzmueller
df0d7c0049 Do not owerwrite specific CiteFormat def with default def
amends 5996b2e373 and fixes natbib numerical display
2019-04-19 09:04:23 +02:00
Juergen Spitzmueller
d8afb81832 Break long string 2019-04-19 09:04:11 +02:00
Juergen Spitzmueller
5e385d0513 Formalia 2019-04-19 09:03:47 +02:00
Juergen Spitzmueller
8ecef0fcbc Available modules should not be editable. 2019-04-18 17:33:37 +02:00
Juergen Spitzmueller
8ee2ffaa52 Amend 3615a6a75b
Natbib provides separation of abbreviated and full author list also
beyond BibTeX
2019-04-18 16:27:22 +02:00
Jean-Marc Lasgouttes
c6754ed548 Do not redefine a stripped-down LyXRC object.
I am not sure why it was done this way, but it is not really necessary.
Moreover gcc LTO does not like it.
2019-04-18 15:55:40 +02:00
Günter Milde
6dd505c67a Don't force encoding switch for Japanese "listings" auto-strings.
listings copes with variable-width encodings under platex.
2019-04-18 15:27:24 +02:00
Kornel Benko
6eb9452836 Amend [f2029fb3/lyxgit]
Omitting acces to invalid index
2019-04-18 15:07:30 +02:00
Kornel Benko
d11bcac11a Add Notion entry to paragraph-select function
Thanks Pavel
2019-04-18 14:55:51 +02:00
Juergen Spitzmueller
aec50eec49 Fix doxygen comment 2019-04-18 14:51:10 +02:00
Juergen Spitzmueller
3615a6a75b Make usage of natbib without BibTeX more obvious
Fixes: #5549
2019-04-18 14:48:01 +02:00
Juergen Spitzmueller
70b3d3adcc Add NewlineCmd InsetLayout and Argument option
This allows to specific an alternative macro for newlines

Fixes: #10407
2019-04-18 11:35:03 +02:00
Juergen Spitzmueller
ed44bbddee Add MenuString to InsetLayout
Fixes: #8818
2019-04-18 10:27:19 +02:00
Enrico Forestieri
17abf68bac Amend [f2029fb3/lyxgit]
The fix for #11552 was reintroducing #9348. This commit makes sure
it stays fixed.
2019-04-17 18:08:46 +02:00
Enrico Forestieri
f2029fb386 Fix bug #11552
Do not insert a brace inset when we know that LyX wrote the braces.

This commit amends [503f7db2/lyxgit].
2019-04-17 16:03:13 +02:00
Kornel Benko
6747b3fe97 Don't switch encodings if in search modus 2019-04-17 07:40:31 +02:00
Günter Milde
27ba6f282d Rename legacy input encoding settings.
Format incremented to 573
2019-04-16 20:17:32 +02:00
Kornel Benko
e0f5641089 Select the whole paragraph with tripple-left-click
Fixes #9175

Also added new function: paragraph-select.
2019-04-16 19:50:31 +02:00
Jean-Marc Lasgouttes
f6f08f0c50 Revert "Make math autocorrrect work with more than 2 chars"
This reverts commit 144e7d7159.
2019-04-16 16:04:12 +02:00
Jean-Marc Lasgouttes
8e3972c35d Revert "Allow to undo partly math autocorrect"
This reverts commit f7a11ca711.
2019-04-16 16:03:57 +02:00
Jean-Marc Lasgouttes
048f9ee08e Rewrite the code that sets caret height in mathed
Instead of remembering the caret ascent and descent for the cell that contains the cursor, the new code remembers caret dimension for each MathRow object. This makes the code much less fragile (ans slightly smaller).

This fixes caret size issues when the Update::SinglePar flag is active.

Fixes bug #11541.
2019-04-16 15:58:51 +02:00
Jean-Marc Lasgouttes
f7a11ca711 Allow to undo partly math autocorrect
To this end, introduce Undo::splitUndoGroup, which ends currently
group and creates a new one with same nesting level.
2019-04-16 14:12:34 +02:00
Isaac
144e7d7159 Make math autocorrrect work with more than 2 chars 2019-04-16 14:12:34 +02:00
Enrico Forestieri
506324ef9d Properly fix #9616
Now all symbols in the unicodesymbols file having a mathcommand
are not wrapped in a \text inset anymore.
2019-04-15 20:56:52 +02:00
Juergen Spitzmueller
7ec81c651e Listings: language updates
Patch by Sergei Winitzki
2019-04-15 11:55:46 +02:00
Günter Milde
da23637d7f Do not switch the input encoding inside documents using platex.
Fixes wrong and missing characters in text parts in other languages
(platex does not support "inputenc").

Fixes compilation errors due to desynchronized encoding switches.
2019-04-12 18:08:17 +02:00
Günter Milde
ad8d1af907 platex input encodings: move handling of some "force" exceptions to unicodesymbols. 2019-04-12 18:08:17 +02:00
Günter Milde
f838b4fb18 platex fixes.
* Force unicodesymbols conversion for all *-platex input encodings,
* except some characters that work well in utf8.
* Use platex if document language is "japanese" and input encoding is "utf8".
2019-04-11 01:43:44 +02:00
Günter Milde
02e7bb80d3 Force unicodesymbols conversion with uf8-platex.
Fixes Japanese (platex) documents with text parts in other languages.
2019-04-10 16:08:43 +02:00
Günter Milde
6fd263122d Typographical corrections. 2019-04-10 15:59:17 +02:00
Jean-Marc Lasgouttes
f9da28428a Fix bold-like characters when selecting bidi text
In painter, restrting paining regions does not really work when region is empty.

Fixes bug #11198.
2019-04-09 11:32:22 +02:00
Kornel Benko
3f9cdc7c63 Amend e55ed79d: Extend handling of Noto fonts
Also renamed
        known_roman_fonts -> known_roman_font_packages
        known_sans_fonts -> known_sans_font_packages
        known_typewriter_fonts -> known_typewriter_font_packages
        known_math_fonts -> known_math_font_packages
2019-04-08 11:44:53 +02:00
Juergen Spitzmueller
dfde45a01a Do not attempt to show module info for category headers 2019-04-07 13:57:41 +02:00
Kornel Benko
6fc7739053 Adapt tex2lyx to the noto fonts extension 2019-04-07 13:47:45 +02:00
Kornel Benko
35ac73a425 Update tex2lyx tests due to format change 2019-04-07 13:30:31 +02:00
Juergen Spitzmueller
6482ddee30 tabular-style-insert: add rows also for 1x and 2x tables
Fixes: #11537
2019-04-07 12:10:03 +02:00
Juergen Spitzmueller
823263904f GuiDocument: Sort available modules by category
Also improve display of module information
2019-04-07 11:23:19 +02:00
Kornel Benko
e55ed79da9 Extend handling of Noto fonts
Added the possibility to use options Regular, Medium, Thin, Light, Extralight
2019-04-07 11:05:42 +02:00
Juergen Spitzmueller
6fef1cec1f Fix crash in GuiBibtex 2019-04-05 17:53:41 +02:00
Günter Milde
2183978f1a Amend 6def81f30f. Never switch encodings with XeTeX or LuaTeX. 2019-04-05 16:14:58 +02:00
Juergen Spitzmueller
38fbbf07cd GuiDocument: Add filter to modules selection
Sorting by category is needs more work, since the GuiIdListModel is
not suitable for trees.
2019-04-05 11:54:44 +02:00
Juergen Spitzmueller
fa79ff2db2 Resolve some implicit conversion warnings. 2019-04-05 11:54:44 +02:00
Juergen Spitzmueller
b5af05b4a7 Make module categories (almost) great again
The category tag was rarely used and thus not very useful. This adds
categorization to most modules (the rest will follow) and uses the
\DeclareCategory tag we use in layouts rather than the extra syntax
we used in modules. Categories are now added to the po files and
translated.

Note that this is work in progress: the current categories are still
subject to change.

The ultimate goal of this is to sort the modules in the GUI by category
as we do with layouts, examples and templates (and add a filter to search
for specific modules)

As it is now (with the many modules we accumulated), the module selector
is not really usable anymore. If you don't happen to know how exactly a
module is named, selecting a module is really a PITA.
2019-04-04 18:43:29 +02:00
Juergen Spitzmueller
f51fa38123 Prevent multiplication of preamble code
Fixes rest of #8229
2019-04-04 16:39:20 +02:00
Juergen Spitzmueller
0b54650f0e tex2lyx: improve module support
The current heuristics only considered modules with styles that defined
a searched command in their preamble, and only for commands/environments
that were defined in the document's preamble. This limited the module
support drastically.

The new heuristics also checks for commands coming from packages. If the
command is not (re-)defined in the document preamble, it checks modules
that provide a style with a matching LaTeXName, checks for their
requirements and matches those with the packages loaded by the document.

If no module provides a searched style, but we found modules that load
packages that are loaded in the imported tex file, and if those packages
are not auto-loaded by LyX anyway, we also load this module.

fixes: #11259, part of #8229
2019-04-04 16:01:07 +02:00
Juergen Spitzmueller
a5e89c842f update tex2lyx tests
\cmidrule(lr) now natively imported.
2019-04-04 09:33:53 +02:00
Juergen Spitzmueller
171e251189 tex2lyx: support for cmidrule trimming 2019-04-04 09:33:36 +02:00
Juergen Spitzmueller
7f24e3ad4f Update tex2lyx tests 2019-04-04 08:24:51 +02:00
Juergen Spitzmueller
97d3b73e9a Disable TABLUAR_STYLE_INSERT with TABULAR_INSERT 2019-04-04 08:24:25 +02:00
Juergen Spitzmueller
2709c5fb58 Initialize TabularCreate dialog enabled.
As pointed out in #10105.
2019-04-04 08:23:27 +02:00
Juergen Spitzmueller
324bfe90df Improve error message
* Take preceding line break out of the l10n range. This is bound to get
  lost in translation
* Display encoding names that people actually find in the GUI
2019-04-03 17:58:20 +02:00
Juergen Spitzmueller
4d513ca49e de.po 2019-04-03 17:57:38 +02:00
Juergen Spitzmueller
f60bda37a6 booktabs trimming: fix some thinkos 2019-04-03 17:18:21 +02:00
Juergen Spitzmueller
bf5d5e5d66 Fix cmidline trimming with multicolumns 2019-04-03 16:35:08 +02:00
Günter Milde
6def81f30f Fix #10600: XeTeX with 8-bit TeX fonts requires input encodings "utf8" or "ascii".
* New: support also utf8 (working around false positive test in "inputenc.sty").

* Do not force the change of input encoding to "ascii".

  Deny compilation with XeTeX if a document uses TeX fonts and a non-supported input encoding.
2019-04-03 15:32:44 +02:00
Jean-Marc Lasgouttes
051da4ba25 Fixup 283ac91a: Forgotten test for null pointer 2019-04-03 12:13:13 +02:00
Jean-Marc Lasgouttes
5e2b24c2a9 Document itemize bullets
Make the unicode value explicit as we do elsewhere.

Also change the value used for labeliv, since the current one may be
square with some fonts.
2019-04-03 12:03:24 +02:00
Jean-Marc Lasgouttes
283ac91aa7 Put end label on own row after display inset
This corresponds to what is done on display. The same should be done
for start label too (e.g. beginning of a proof), but this requires more
work.

This required to move the static function getEndLabel to Text.

Fixes bug #11536.
2019-04-03 11:17:14 +02:00
Juergen Spitzmueller
8085fc21f8 booktabs: support for \cmidrule trimming
This has probably still some rough edges, so please test thoroughly.

Fixes: #3072
2019-04-03 07:59:52 +02:00
Jean-Marc Lasgouttes
3b58e38dc6 Fixup ad79ac40: reintroduce markers around delimiters
The reasoning behind this change was not correct.

Fixes bug #11516.
2019-04-02 14:32:32 +02:00
Jean-Marc Lasgouttes
f609a4717f Pass a pit to Text::isRTL(), not a paragraph 2019-04-02 09:56:42 +02:00
Juergen Spitzmueller
0c18f6a8c1 Remove TODO entry
This is covered in the "Consider layouts in modules that do not have a
preamble definition" general TODO item.
2019-04-01 13:04:05 +02:00
Juergen Spitzmueller
9d384c3c12 Fix tooltip.
Thanks, Kornel.
2019-04-01 11:28:54 +02:00
Juergen Spitzmueller
a8f778b66c reset.formal-default: no need to fiddle with left/right lines at all. 2019-04-01 09:27:12 +02:00
Juergen Spitzmueller
00de6c4be7 Fix left/right border UI when toggling formal
Fixes: #9835
2019-04-01 09:26:09 +02:00
Juergen Spitzmueller
b0f9d98d6e Remove Qt 5.12-only colorrole
Designer inserts those automatically. So we have again backwards-incompatible
designer behavior :-(
2019-04-01 09:18:16 +02:00
Juergen Spitzmueller
3bbcfda3db Add option to reset to default booktabs lines
Addresses: #10106
2019-04-01 07:08:13 +02:00
Juergen Spitzmueller
819c9c1645 Fix booktabs bottom line with multirows
Fixes: #11445
2019-04-01 05:43:32 +02:00
Juergen Spitzmueller
18ee587a1e Add listpreamble tex2lyx test 2019-03-31 17:52:31 +02:00
Enrico Forestieri
45e0ce2372 Fix bug #11528
The code was not doing what said in the description.
2019-03-31 15:14:28 +02:00
Juergen Spitzmueller
b1c36045ee fix typo in comment 2019-03-31 14:30:55 +02:00
Juergen Spitzmueller
57157d2e4d tex2lyx: support for list preambles 2019-03-31 14:27:56 +02:00
Kornel Benko
e5b98a86fa Amend 99eeb29e: tex2lyx test: make box-color-*.tex sample compilable 2019-03-31 00:52:04 +01:00
Juergen Spitzmueller
c12190b5e5 GuiBibtex: add button to edit individual databases externally
This complements the inset context menu function, which only allows for
editing all databases externally
2019-03-30 11:37:28 +01:00
Juergen Spitzmueller
02974ff2a9 GuiSelectionManager: properly handle de-selecting items
When an item is de-selected with the mouse, and thus no item selected
anymore, disable add, up, down and delete buttons.
2019-03-30 11:36:47 +01:00
Juergen Spitzmueller
aa5add6b96 Consider individual bib file encoding when parsing 2019-03-30 09:50:55 +01:00
Juergen Spitzmueller
4d54d3afca Fix some implicit conversion issues. 2019-03-30 09:33:09 +01:00
Juergen Spitzmueller
d8bdfa8462 Update paths in tex2lyx tests 2019-03-29 16:08:17 +01:00
Juergen Spitzmueller
f8aee7068e Adapt tex2lyx tests to version numbers. 2019-03-29 15:51:50 +01:00
Juergen Spitzmueller
035d539964 tex2lyx: support for bibencoding argument of \addbibresource 2019-03-29 15:50:18 +01:00
Juergen Spitzmueller
f75b081551 Add support for mixed-encoded biblatex files
Biblatex 3.12 allows to specifiy individual encodings per bib file
via \addbibresource[bibencoding=<encoding>].

This is now supported via GuiBibtex.
2019-03-29 15:45:55 +01:00
Juergen Spitzmueller
0042fb34d0 Fix some group boxes. 2019-03-29 13:01:47 +01:00
Jean-Marc Lasgouttes
dfba0d8667 Fix insertion of text characters in math
Characters that needed to be inserted in text mode in mathed were not
correctly inserted. Here we do two fixes:

1/ in niceInsert(), do not replace the contents of the active insets
first cell with selection, insert selection instead. This wa sthe
cause of the bug: an empty selection replaced the contents that was
already in the cell.

2/ do not use niceInsert() anyway, insert() is perfect for what we
want to do.

Fixes bug #11527.
2019-03-28 13:22:38 +01:00
Günter Milde
2067bff2cb Babel's "\textlatin" is obsoleted by "\ensureascii". 2019-03-27 09:52:44 +01:00
Juergen Spitzmueller
e2761dd2f2 Update version numbers of tex2lyx tests 2019-03-26 17:49:38 +01:00
Juergen Spitzmueller
4b3aacd13b Add TableStyle layout tag
Fixes: #8360
2019-03-26 17:42:56 +01:00
Juergen Spitzmueller
ecb2427f41 Add tablestyle buffer param
Fixes: #9901
2019-03-26 16:24:27 +01:00
Juergen Spitzmueller
683b3a05e2 Introducing table templates
The idea is simple: we insert a pre-formatted table (with a given border
style currently, but other attributes are possible as well) via file-insert
and scale it then to the requested size.

We need three sizes (1x1, 1x2 and 1x3) to generate all sizes properly (due
to border specifications).

Currently, these styles can only be accessed via lfun tabular-style-insert
and the Tabular Create dialog.

My plan is to add a buffer param to set a default style (#9901) which then
also is respected by the toolbar button and probably a layout tag to let
classes specify a default style (#8360).
2019-03-26 13:43:33 +01:00
Juergen Spitzmueller
2ed3b22a06 Add ignorelang option to file-insert
This is useful for inserted files with no real text content
2019-03-26 10:13:33 +01:00
Juergen Spitzmueller
2860266e30 remove buildlyxdir again
per request
2019-03-25 16:46:04 +01:00
Juergen Spitzmueller
414db90a5c Indentation 2019-03-25 16:46:03 +01:00
Juergen Spitzmueller
f04d7d0d7c Remove accidentally committed debug statement 2019-03-25 08:07:07 +01:00
Kornel Benko
d49b5fdde3 Disable the debug output which made exports using lyx2lyx fail 2019-03-24 22:17:48 +01:00
Juergen Spitzmueller
dc7e7808df Add buildlyxdir placeholder for \origin
This allows resolving paths properly in the build dir.
2019-03-24 17:34:28 +01:00
Enrico Forestieri
c2af2cfd94 Fix bug #11526
Correctly categorize a textmode symbol in mathed.
2019-03-24 17:28:01 +01:00
Juergen Spitzmueller
6852e35b1d GuiLyXFiles: handle defaults.lyx 2019-03-23 17:41:42 +01:00
Juergen Spitzmueller
3dc54d4aac Display URL-encoded chars decoded in display path 2019-03-23 15:15:08 +01:00
Juergen Spitzmueller
b8842a1584 Add l10n mark 2019-03-23 12:45:28 +01:00
Juergen Spitzmueller
c02ed04127 Save as Template: Also consider document language
Attempt to save the template in the appropriate language subfolder of
the user template directory (and propose to create it if it doesn't exist
yet).

That way, user-generated templates (1.) get the correct language attribution
in the lyxfiles dialog and (2.) users can easily generate different
language versions of a template.
2019-03-23 11:00:13 +01:00
Juergen Spitzmueller
ebc4092649 Add LFUN_BUFFER_WRITE_AS_TEMPLATE
Convenience function to easier save a file as template in the appropriate
templates folder.
2019-03-23 10:17:33 +01:00
Pavel Sanda
066a164ba6 Forgotten accelerators. 2019-03-22 22:14:21 +01:00
Juergen Spitzmueller
aff2ee6058 Add soul module 2019-03-22 18:29:50 +01:00
Jean-Marc Lasgouttes
d52e04a9b3 Fix fonts used by sub/superscript in text
Several changes are needed to get things right:
* nested supersripts only work with inheritFonts=true.

* to get caret position right, it is necessary to remember the outside
  font of the inset before computing metrics.

* to get the size right at insertion time, it is necessary to trigger
  a metrics computation just after inset insertion.
2019-03-22 16:19:52 +01:00
Jean-Marc Lasgouttes
cfb8b214d1 Treat math style a bit more like other font features
While math style (scriptstyle,...) is not really something that can be
set, it is useful for text subscripts and superscripts and therefore
it makes sense to handle it in some places.

With this change, style is still not a first class feature, but good
enough for now. In particular, it is taken into account in update().
2019-03-22 16:19:05 +01:00
Jean-Marc Lasgouttes
b79a694c56 Compilation fix 2019-03-22 14:56:33 +01:00
Juergen Spitzmueller
6efdd1c399 Cosmetics 2019-03-22 14:18:17 +01:00
Juergen Spitzmueller
58c4c11c4c Use GuiLyXFiles also for ui, kbd and bind files in prefs 2019-03-22 14:14:33 +01:00
Juergen Spitzmueller
9a2c5b515a Disable language combo if there is nothing to select 2019-03-22 14:14:33 +01:00
Juergen Spitzmueller
b7f6c16a48 Fix duplicate language entry 2019-03-22 14:14:32 +01:00
Juergen Spitzmueller
55012674c8 Add forgotten replacement 2019-03-22 11:25:20 +01:00
Juergen Spitzmueller
ca024383e0 Fix problematic characters in example/template file names
For (, ) and & we use URL encoding now.
2019-03-22 11:10:49 +01:00
Juergen Spitzmueller
9a473a4954 Fix header case 2019-03-21 19:31:46 +01:00
Juergen Spitzmueller
7403fd2f88 Replace Type combo, which was considered irritating, with a Type filter
The new one allows to display only user or system files.
2019-03-21 19:25:10 +01:00
Jean-Marc Lasgouttes
e170051909 typo 2019-03-21 18:45:46 +01:00
Juergen Spitzmueller
4b2cce9e0f Consider files only in lang subtrees 2019-03-21 14:39:33 +01:00
Jean-Marc Lasgouttes
601244ba92 Use HAVE_LONG_LONG_INT instead of LYX_USE_LONG_LONG
It seems that the extra complication hurts more than it helps (for
example with OpenBSD).

Some adaptation will be needed for cmake.
2019-03-21 14:18:17 +01:00
Juergen Spitzmueller
cd9f52da89 GuiLyXFiles: fix icons and tooltips 2019-03-21 14:18:03 +01:00
Juergen Spitzmueller
7f39be8664 GuiLyXFiles: prefill language combo 2019-03-21 13:40:11 +01:00
Kornel Benko
ebc7105c36 FindAdv: Cosmetics
Remove parentheses from return statements,
add '_' to private members
2019-03-21 12:58:16 +01:00
Jean-Marc Lasgouttes
c2732a30f9 Mark inserted/deleted end of paragraph using pilcrow
Instead of the weird corner line, display a pilcrow sign (even when
disabled in prefs) to mark inserted/deleted end of paragraph.

Incidentally, this fixes the recent placement bug of the corner line.
2019-03-21 11:31:39 +01:00
Jean-Marc Lasgouttes
5d30f790dd Compilation fix
For some reason I need this (maybe a Qt4/5 discrepancy).
2019-03-21 10:28:16 +01:00
Juergen Spitzmueller
7be8307768 GuiLyXFiles: rework language selector
Now only the languages available for the selected file are displayed.
By default, LyX pre-selects the GUI language (and falls back to English
if this is not available). Once another language has been selected by
the user, this one is preferred before the GUI language (and the English
fallback).
2019-03-21 09:13:09 +01:00
Kornel Benko
e55244ccd8 FindAdv: Added remaining accents(2) dgrave, textdoublegrave, rcap, textroundcap 2019-03-20 23:22:29 +01:00
Juergen Spitzmueller
ca67b8aa2c GuiLyXFiles: add icons that indicate whether a file is from user or system 2019-03-20 18:38:07 +01:00
Juergen Spitzmueller
1222ce3bfe Add Qt-internal string for translation 2019-03-20 18:37:34 +01:00
Jean-Marc Lasgouttes
1c755fefa5 Initialize hasTitle in Intervall constructor
I also moved around some things while I was at it.

Spotted by coverity scan.
2019-03-20 17:26:56 +01:00
Juergen Spitzmueller
f3ee82fb87 Do not close LyXFiles dialog on double-clicking header 2019-03-20 12:37:55 +01:00
Juergen Spitzmueller
07e20fbb2f Amend 0c8eea0fe5 2019-03-20 12:36:39 +01:00
Jean-Marc Lasgouttes
0c8eea0fe5 Compilation fix for Qt < 5.2. 2019-03-20 11:45:29 +01:00
Jean-Marc Lasgouttes
d3979e798c Cache the value of GuiFontMetrics::lbearing().
This seems to be necessary on windows, where math editing can get very
slow. Note that other methods like rbearing already use a cache.

In the future all these caches for single characters shall be unified.
2019-03-20 11:14:43 +01:00
Günter Milde
d6d98ffbe4 Fix remainder of #9681 (textcyrillic and textgreek handling).
* Fix macro termination if \textcyrillic or \textgreek is not required
  for Greek or Cyrillic letter.

* Replace "writeScriptChars" with conditionals in the character-output loop in
  "Paragraph::latex" (solves "FIXME: modifying i here is not very nice...").

The font changing commands \textcyrillic and \textgreek are no longer
part of the textcommand in "lib/unicodesymbols" but added when required
in Paragraph::Private::latexSpecialChar.
2019-03-19 22:46:33 +01:00
Günter Milde
1933102593 ctest update and small documentation fixes. 2019-03-19 22:17:52 +01:00
Juergen Spitzmueller
b52cb87e9a GuiLyXFiles: add language selector. 2019-03-19 17:55:19 +01:00
Juergen Spitzmueller
52d2ba16ed GuiLyXFiles: A bit more work towards generalization
Bind and Ui files can be displayed in this dialog now (via lfun
dialog-show lyxfiles ui|bind), although it is not yet usable in prefs.
2019-03-19 17:00:01 +01:00
Juergen Spitzmueller
adbe5121fe cosmetics 2019-03-19 13:36:05 +01:00
Juergen Spitzmueller
e141781aad GuiLyXFiles: minor generalization 2019-03-19 13:29:32 +01:00
Juergen Spitzmueller
7271325ba7 Fix strings 2019-03-19 07:42:11 +01:00
Juergen Spitzmueller
d3ec77c633 Reorganize templates and example folders
Re-structure and rename files in a transparent way. Most template/example
names now correspond to the (verbose GUI) name of their layouts.

Note that this, most prominently, also changes [LANG/]splash.lyx to
something less insiderish, namely "Welcome.lyx".
2019-03-19 07:13:18 +01:00
Juergen Spitzmueller
9faae1284b Add new dialog for templates and examples
This lists all respective files from user, build and system directory
in a structured way and thus allows for easier access to them.

Fixes: #2396, #6861
2019-03-19 06:59:24 +01:00
Kornel Benko
d7354a1a09 FindAdv: Polishing
1.) Use vector for borders, because any value may be too small
  if there are plenty of accented characters in a paragraph
2.) use '[\S]' instead of '.' in regex for 'accre'. The regex would
  otherwise find also patterns like '\ {some text}'
2019-03-18 18:28:49 +01:00
Günter Milde
553bebc355 Fix #11520 Wrong inpute encoding when master and child use different setting. 2019-03-18 18:17:39 +01:00
Günter Milde
dae90c6161 Warn user, if input encodings of master and child document differ. 2019-03-18 18:17:39 +01:00
Kornel Benko
9e825d5035 FindAdv: Added remaining accents cedilla, subring, subhat subtilde 2019-03-18 12:59:40 +01:00
Kornel Benko
13b3808aa0 FindAdv: Casting to satisfy Windows compiler
Thanks to Jean-Marc Lasgouttes
2019-03-18 09:38:34 +01:00
Jean-Marc Lasgouttes
9a15d35443 Fix MSVC warning 2019-03-17 14:28:22 +01:00
Jean-Marc Lasgouttes
bdf3924fc7 Update poor man's profiler to use C++11 std::chrono
This is more portable, and the old code prevented in windows to use
instrument several classes at the same time (several .obj files,
actually).

No new feature here, bu the code is nicely slower. It might be less
efficient, I am not really at ease with how std::chrono works.
2019-03-17 14:01:02 +01:00
Kornel Benko
bf4394e282 FindAdv: Expand the list of handled chars for ogonek 2019-03-17 13:06:56 +01:00
Günter Milde
406b1e7fcf Small formatting and comments update. 2019-03-16 12:59:34 +01:00
Kornel Benko
9a1a806b60 FindAdv: Correct start of search if not using regex
Do not try to find pattern inside the leading string.
2019-03-16 11:26:20 +01:00
Juergen Spitzmueller
85b36769cb Handle \protect'ion of label in listings
Since listings labels are passed as an argument of their own, we need
to strip the \protect flag.
2019-03-16 09:05:04 +01:00
Kornel Benko
8e7c427c7c Amend 7ac04a2b: Count and display number of replaced strings in FindAdv
We have to know if the previous call to search was a single replace or not,
so that we can correctly initialize the numer of replaed strings.
2019-03-16 08:17:09 +01:00
Juergen Spitzmueller
f0282ddff4 Do not force LTR with nameref and non-TeX fonts
Fixes: #11518
2019-03-15 11:23:53 +01:00
Richard Kimberly Heck
4484cc7751 Fix regression concerning collapsing insets after search.
To reproduce: Do a search for text in a footnote (say) that is
currently closed. Click inside the now open footnote. It will close
by itself.

We need to know whether we can go into the inset, not whether we can
edit once we're there.
2019-03-14 20:30:50 -04:00
Juergen Spitzmueller
3272c5a3f4 Protect label in moving argument
Fixes: #9404
2019-03-14 14:38:08 +01:00
Juergen Spitzmueller
262e436fc3 Move labels and insets out of moving arguments
Fixes: #2154
2019-03-14 14:24:43 +01:00
Kornel Benko
4eacc492a3 Typo 2019-03-13 14:14:35 +01:00
Kornel Benko
7ac04a2b75 Fix #11505. Count and display number of replaced strings in FindAdv 2019-03-13 14:06:18 +01:00
Günter Milde
4a481975b6 Use CJKutf8 package if input encoding is "utf8" and a used language requires CJK.
CJKutf8 now used also if a secondary language requires CJK.
2019-03-13 11:31:25 +01:00
Günter Milde
0f265a5ab6 Remove special code for CJK that is no longer required (amends e665715fc4). 2019-03-13 11:13:44 +01:00
Jean-Marc Lasgouttes
f659af339e Revert "Let tm be a reference here as elsewhere"
This commit was wrong because a reference variable can never be
re-assigned (it would change the original variable). I learn C++
pitfalls every day.

Fixes bug #11512.

This reverts commit 10e2c65835.
2019-03-12 16:03:22 +01:00
Jean-Marc Lasgouttes
63bfaa14be Make TextMetrics noncopyable
This is done by declaring unimplemented private copy constructor and
assignment operator.

This breaks compilation in BufferView::textMetrics, which does a copy when
inserting a TextMetrics object in the cache. Some C++11 wizardry I will not
pretend to completely understand saves the day.

See the following page for details:
  https://en.cppreference.com/w/cpp/container/map/emplace

This avoids real world bugs like #11512.
2019-03-12 16:03:22 +01:00
Juergen Spitzmueller
8b92a2a689 Add NeedMBoxProtect [inset]layout option
This accesses the inulemcmd output param which protects specific commands
(\cite, \ref) in an \mbox.

This is needed in ulem and soul commands, since their complex
detokenization makes such commands (who produce multiple words via local
assignment) fail.

So now it is possible to properly support ulem and soul via
[inset]layout

Fixes a case reported in #9404
2019-03-12 14:08:05 +01:00
Juergen Spitzmueller
c41df5b671 Warn if included file does not exist
Patch by Jürgen Womser-Schütz
2019-03-12 09:00:59 +01:00
Juergen Spitzmueller
3c83f01f1b More exceptions to percent encoding
See #11511
2019-03-10 16:37:31 +01:00
Juergen Spitzmueller
936cddc715 Do not percent-encode & in urls
This is query syntax

Fixes: #11511

follows up [c2db448ff5/lyxgit]
2019-03-10 13:23:36 +01:00
Juergen Spitzmueller
de449daa71 update tex2lyx tests after file format change 2019-03-10 13:04:15 +01:00
Juergen Spitzmueller
ebd7a1a22a Support for the Malayalam language
Patch by Joice Joseph
2019-03-10 10:21:59 +01:00
Kornel Benko
c041439c51 FindAdv: Special handling for \dot{i} and 'ß'
Different behaviour in regexp{..} for 'İ' and 'ß':
1.) lowercase routine for 'İ' gives 'İ', so that if we are searching
  while ignoring case, the string '\dot{I}' is converted to '\dot{i}'.
  In this case we have to change it to 'İ' (instead of 'i', as one would expect).

2.) If 'ß' is inserted via keybord on fresh created regexp box it appears as \lyxmathsym{ß},
  if pasted from the lyx-screen it appears as \text{ß}
2019-03-10 00:29:56 +01:00
Kornel Benko
99e216b78d Amend 62f8b8be
The file test-insets.tex is changed, therefore the file
which is expected by tex2lyx (test-insets.lyx.lyx) has to be changed too.
2019-03-09 21:24:21 +01:00
Juergen Spitzmueller
55c9bc218a Do not use GUI language for shortcut info inset if no translation is available
Fixes: #11508

Now there is the opposite case which needs to be addressed:
If no translation is available for a shortcut in a non-latin-scripted
document, we need to switch the language to English.
2019-03-09 12:00:40 +01:00
Kornel Benko
f848183fa8 FindAdv: Expand the list of handled chars for dot below and ring above 2019-03-08 22:44:00 +01:00
Juergen Spitzmueller
2078a02ce9 Silence compiler warning 2019-03-08 16:48:49 +01:00
Günter Milde
24b675783f Ensure \LyX macro works also with non-standard font encodings (Greek, ...).
Babel provides the \textlatin macro to ensure Latin letter ASCII characters are
output as Latin letters.

Instead of 8 different definitions for the several variants of the macro definition,
wrappers are individually added if required and available.
2019-03-07 17:01:05 +01:00
Kornel Benko
b702eda4ed FindAdv: Amend cd4ae51f
Prevent to match only part of a macro.
For instance, we want find '\imath' but not '\imathxxxx'
while checking for accents.
2019-03-04 14:37:10 +01:00
Kornel Benko
cd4ae51f77 FindAdv: Amend b21c8b21: Expand the list for handled latin characters
1.) Added for 'breve' and 'grave' accents
2.) Corrected handling for 'i'-accents (allowed \hat{i} _and_ \hat{\imath})
	because of problems with ignoring case
3.) Spaces: Changed some indents in source
2019-03-04 14:05:44 +01:00
Günter Milde
68b6198d63 Fix/simplify "if" clause for application of \textcyrrillic or \textgreek.
Also with Xe/LuaTeX only required with non-native font encodings.
2019-03-04 00:04:03 +01:00
Günter Milde
7dfc6c7f8b Update latex export of combining characters.
* Remove exception for polytonikogreek (drop braces)
  no longer required since the fixes to #6463 and #9637.
* Update comments.
2019-03-04 00:04:03 +01:00
Kornel Benko
99bacf006e FindAdv: Handle some more accented latin characters.
Also try to use UTF8 encoded chars instead of their
latex equivalent if possible.
2019-03-03 14:08:27 +01:00
Kornel Benko
b21c8b214d FindAdv: Expand the list for handled latin characters 2019-03-02 22:00:20 +01:00
Kornel Benko
3541a49db4 FindAdv: Try to add the possibility to search for accented characters in regex
The problem is the handling of regex as using math-mode. That is
any accented character is converted to a math macro.
For instance "ä" --> "\\ddot{a}".
Outside of math or regex it is not converted (if used xetex flavour),
but there are other chars which are converted in math and in text (but differently)
For instance "ů"
	in math --> "\\mathring{u}"
	in text --> "\\r{u}"

TODO: determine the still not handled conversions.
It would be nice, if we could persuade math factory to not convert
these characters, but I was unable to find the place where the
conversion actually takes place.
2019-03-02 15:42:38 +01:00
Günter Milde
e665715fc4 Don't switch encodings when a document wide encoding is specified.
Remove special code for CJK that is no longer required after
we use CJKutf8 document-wide with inputenc "utf8-cjk"
(and "utf8" for languages requiring CJK) (since 7bbf333fa1).

CJK characters can no longer be used with a document-wide 8-bit encoding.
(Hint: Use utf8-cjk or one of the CJK legacy encodings if your document contains CJK characters.)
2019-02-28 22:55:43 +01:00
Kornel Benko
9d6b71c6b3 FindAdv: Use isAlnumASCII() instead of std::isalnum()
Thanks Jean-Marc
2019-02-28 13:00:12 +01:00
Jean-Marc Lasgouttes
32d6396f88 Use || instead of or operator
It is more consistent and visual studio seems to dislike it anyway.
2019-02-28 12:03:34 +01:00
Kornel Benko
2c5c397afa Amend aaffcd0b: Remove some remnants ... 2019-02-27 10:33:25 +01:00
Kornel Benko
aaffcd0b39 FindAdv: Do not use data from included listing if in search mode
Fixes #11496 	"Find and replace (advanced)" is too slow
2019-02-27 10:17:56 +01:00
Kornel Benko
b1f93e0982 FindAdv: Try to use a better algorithm to find begin of a searched string 2019-02-26 23:00:31 +01:00
Jean-Marc Lasgouttes
954531f247 Update screen as needed when preferences are changed
This commit removes the adhoc code in GuiPrefs and moves it to LyXRC,
so that it triggers in every preference change.

The code has also been updated to trigger on more variables, e.g.
font_*_foundry.

Note that the actual function that are called have not been changed
(addPreviews and LFUN_SCREEN_FONT_UPDATE), although there are doubts
that they behave as needed (see FIXMEs).

Fixes bug #11498.
2019-02-26 16:53:14 +01:00
Kornel Benko
babb291ef3 FindAdv: Partially revert e69f7022
The slowness returns, but the search works again
2019-02-26 13:24:36 +01:00
Richard Kimberly Heck
5b959033d2 Fix bad error message (bug 11486). 2019-02-25 21:56:40 -05:00
Jean-Marc Lasgouttes
4028eefe61 Make callstack printing useful and optional
When callback printing is enabled, link lyx with -rdynamic, so that
stacks have LyX symbols available.

Add option --disable-callstack-printing to configure.

Running "size" on binary:
 * with callstack printing support
   text	   data	    bss	    dec	    hex	filename
20891684	  34680	 107796	21034160	140f4b0	src/lyx

 * without callstack printing support
    text	   data	    bss	    dec	    hex	filename
17953640	  34648	 107796	18096084	1141fd4	src/lyx
2019-02-25 17:58:06 +01:00
Jean-Marc Lasgouttes
bc128e7bf8 Use range-based loops in BufferList 2019-02-25 15:19:58 +01:00
Jean-Marc Lasgouttes
7f0525e9e0 Change the way scrolled rows are tracked
The goal of this commit is to simplify the logic in TextMetrics::draw.
Now, rows are repainted depending on their changed() status.

Instead of checking whether rows have been scrolled horizontally at
draw time, the code marks the row as changed when testing for
horizontal scrolling.

To this end a new method TestMetrics::setRowChanged is added, that
searches a row in the text metrics cache and marks it changed if
found.

The old code that remembered the previously scrolled row can now be
removed.
2019-02-25 15:19:58 +01:00
Kornel Benko
e69f702275 FindAdv: Fix #11496 -- too slow find
Also added some more macros to handle
2019-02-25 12:12:19 +01:00
Jean-Marc Lasgouttes
ab02a907f0 Move some TextMetrics code around.
No change intended.
2019-02-25 11:58:50 +01:00
Kornel Benko
6a6b670bbd FindAdv: Correctly match '\[' and '\]' in regular expressions with format enabled
We have to check for instances of '{[}' and '{]}' and
omit removing the enclosing parentheses
2019-02-23 13:11:34 +01:00
Kornel Benko
44a06adb6c FindAdv: debug info
1.) Fill the 'head'-member to easier recognize the macro. May be discarded
 later, although it does not take too much run-time
2.) Add some comment
3.) Ignore any macro inside the regex.
2019-02-22 13:21:23 +01:00
Kornel Benko
01fd1f7679 FindAdv: Discard \parbox, \input macros
The languge of these macros does not matter. What's more,
without removing them we may obtain wrong matching.
2019-02-21 20:32:08 +01:00
Kornel Benko
8a0db92523 FindAdv: Handle \shortcut
Essentially remove the header and handle the language inside
\shortcut{...} appropriately
2019-02-21 14:45:41 +01:00
Jean-Marc Lasgouttes
9bdc0dab31 Honor Update::SinglePar properly
The SinglePar update flags has been a no-op for a long time without
naybody noticing. This means that the current paragraph was
always rebroken and redrawn, even when only moving the cursor around.

Now we only do that when Update::SinglePar has been specified. This
means that there may be cases where update will not be correct
anymore, because this flag has not been specified. These places will
have to be found and fixed.

Update PAINTING_ANALYSIS.
2019-02-20 14:41:22 +01:00
Kornel Benko
a298fc55d9 FindAdv: Added handling for latex environments
1.) Make sure the environment is mentioned in the string for search
  (Added the keyword \latexenvironment{...})
2.) Handle it similar to \textcolor{}

That way we can also search for 'conclusion*' or 'summary' etc
in Additional.lyx.
2019-02-20 14:14:50 +01:00
Kornel Benko
0a2dda0904 Findadv: Added handling for frontmatter macros
title, subtitle, author etc.
2019-02-19 23:11:09 +01:00
Enrico Forestieri
c3b9504835 Fix bug #11490
Correctly add the branch name suffix when the stem
of the filename contains a dot.
2019-02-19 19:51:11 +01:00
Jean-Marc Lasgouttes
2ae51b947b Rename TextMetrics::dimension() to dim() 2019-02-19 18:04:43 +01:00
Jean-Marc Lasgouttes
91fc45ed35 Do not use trailing underscore for local variable 2019-02-18 16:04:15 +01:00
Jean-Marc Lasgouttes
4c90183e4d Remove unused method 2019-02-18 16:03:38 +01:00
Jean-Marc Lasgouttes
a04b5c3965 Rename Row::dimension() to dim()
This is what is done elsewhere.
2019-02-18 15:47:27 +01:00
Jean-Marc Lasgouttes
10e2c65835 Let tm be a reference here as elsewhere 2019-02-18 15:47:27 +01:00
Jean-Marc Lasgouttes
26ad2c6a67 Do a round of DEPM after changing layout 2019-02-18 15:36:21 +01:00
Jean-Marc Lasgouttes
386a347484 DEPM: allow to delete empty paragraphs after deleting extra spaces
Remove return statement when spaces have been deleted.

Add an early return in part 2 when current paragraph is not empty.

Remove some comments that concern things that are OK now.
2019-02-18 15:36:21 +01:00
Jean-Marc Lasgouttes
aaab1ad65d DEPM: do not strip explicitly leading spaces
For the local version of DEPM, only what was around old cursor should change

For the global version, leading spaces are already handled.
2019-02-18 15:36:21 +01:00
Jean-Marc Lasgouttes
1f1a1b0dc7 DEPM: replace loop by existing method 2019-02-18 15:36:21 +01:00
Jean-Marc Lasgouttes
b59b968c3e DEPM: reorganize a bit (no change intended)
Exit early if the cursor has not moved.

Place comments where they belong.
2019-02-18 15:36:21 +01:00
Jean-Marc Lasgouttes
2dc62d0405 DEPM: handle undo when deleting spaces
Also, do not do any DEPM when the buffer is read-only.
2019-02-18 15:36:21 +01:00
Juergen Spitzmueller
dbe963a1ef Fix copy/paste error spotted by coverity. 2019-02-18 15:14:16 +01:00
Jean-Marc Lasgouttes
c521e3e1de Initialize member
Spotted by coverity
2019-02-18 15:10:30 +01:00
Juergen Spitzmueller
71737b87f9 Basic support for biblatex-chicago
This uses a specific wrapper package that must be loaded instead of
biblatex.

Via "Requires biblatex-chicago", this is now possible.

For proper support, a citeengine file needs to be written

This commit here could also be backported to stable.
2019-02-18 13:14:53 +01:00
Kornel Benko
96ca66d664 FindAdv: Handle more cases
Some macros need:
1.) Take care of case sensitivity
2.) Better handling of used argument values
3.) Cleaner list-environment search
4.) Remove superfluous '~' if searching for description or labeling env
2019-02-18 00:40:55 +01:00
Kornel Benko
dfbe29317d FindAdv: Even more fine tuning 2019-02-16 18:39:10 +01:00
Kornel Benko
faf7f0666f FindAdv: More fine tuning 2019-02-13 13:41:57 +01:00
Kornel Benko
8d752b68e9 FindAdv: Fine tuning 2019-02-12 14:21:14 +01:00
Günter Milde
296bafa928 Update comment. 2019-02-12 09:30:48 +01:00
Günter Milde
7a17610a00 Load "textcomp" and "pmboxdraw" before "(lua)inputenc" to fix #11454.
Prevents wrong or missing characters with LuaTeX and 8-bit fonts.

Also "uninvert" the corresponding test case and two other
no longer failing "unicodesymbols" exports.
2019-02-12 09:22:55 +01:00
Kornel Benko
a47dbed6bd FindAdv: Try to find real start of found match
Sometime it happen that the selection contains area which was skipped
in splitOnKnownMacros().
So we check, if a shorter selection would give the same mach size.
2019-02-11 13:13:28 +01:00
Jean-Marc Lasgouttes
2215f4c2b4 Fix Visual C++ warnning 2019-02-11 10:44:13 +01:00
Kornel Benko
f19bd163de FindAdv: Add handling of begin{multicols}[...][...]{...}
Also
a.) try to speed up regex search using non-greedy mode (.*?)
b.) remove '\n' completely in searched strings if it is not surrounded with
	aplanumerical chars
2019-02-10 18:00:55 +01:00
Günter Milde
7bbf333fa1 Don't switch encodings to/from CJK if the document encoding is using the CJK package.
Also, since we return earlier if the document encoding is an utf8-variant
since fc0ab1283, the wrapper around "setEncoding" is no longer required.
2019-02-09 20:42:24 +01:00
Kornel Benko
7fa1244dd8 Findadv: Add handling for powerdot macros
With format enabled, these macros were hard to process:
	lyxslide, twocolumn
2019-02-07 13:35:47 +01:00
Jean-Marc Lasgouttes
e203bf519b Fix algorithm for finding localized files
Now we search in priority with the GUI language, and then the
language(s) specified in the LANGUAGES environment variable.
Preoviously, the GUI language would only be considered when
LANGUAGES was not set (which was a bug).

Take this opportunity to remove old compatibility code from 2007.
2019-02-06 15:53:47 +01:00
Günter Milde
426ed23ec0 Fix CJK preamble.
Don't load the CJK package with utf8x (feature clash).

Load CJK (not CJKutf8) with traditional Chinese and "language-default".
2019-02-05 20:29:10 +01:00
Scott Kostyshak
591ee36df0 Comment: add matching parenthesis 2019-02-05 13:42:08 -05:00
Enrico Forestieri
26c692a0c8 Use braces for listings caption
Commit [3366c49f/lyxgit] intended to strip braces only for minted
but was actually stripping them also for listings. As the braces
are necessary for the listings package, reintroduce them.
This is a master-only issue.
2019-02-05 19:04:12 +01:00
Jean-Marc Lasgouttes
5e4fd6c796 DEPM: fix infinite loop. 2019-02-05 11:52:17 +01:00
Günter Milde
fc0ab1283c Check for CJK instead of CJKutf8.
The specific test was introduced in ef6be5f4 because
CJKutf8 was relatively new (cf. lyx.org/trac/ticket/5386).

10 years on, CJKutf8 is an established part of the CJK bundle
and we can skip the special test for CJKutf8 to make the logic
considerabely simpler to read, maintain and debug.
2019-02-05 11:31:27 +01:00
Günter Milde
32e4a85e43 Prevent fallback to "utf8" if "inputenc" package is not loaded.
Since April 2018, pdflatex falls back to input-encoding utf8 if
it does not detect an input encoding setting.
https://www.latex-project.org/news/latex2e-news/ltnews28.pdf

This leads to failure with CJK legacy encodings and may not
be what you want if selecting "Language Default (no inputenc)"
as document input-encoding.
2019-02-05 11:25:33 +01:00
Kornel Benko
50550a215f Findadv: Handle \lettrine{} in initials.module
The problem here is, that selecting any subset of a \lettrine{}
line always creates an initials header. That makes it impossible
to our search engine to find strings, because the regex does not
contain that info. So we have to discard the leading \lettrine part
completely.
We place now a marker (\endarguments) to determine that removable
part.
2019-02-05 08:04:47 +01:00
Jean-Marc Lasgouttes
051b6ce68a Do not rely on x_ when painting label
Additionally fixes a warning about unused value (from clang-analyzer).
2019-02-04 12:15:21 +01:00