Commit Graph

45662 Commits

Author SHA1 Message Date
Pavel Sanda
5b34105514 Group most verbose dbg output into more intuitive categories.
From now on, having all dbg level except of painting and scrolling
shows debug output which can be actually followed.
2023-07-18 22:25:28 +02:00
Jean-Marc Lasgouttes
008cec3eec Honor scroll_below_document when jumping to end of document
While fixing #12491 at 0fed10e4, some band-aids were removed at the
end of `BufferView::scrollToBuffer`. One of them ensured that
scrolling to last paragraph would not leave the last row alone on
screen.

This behavior is actually correct when the scroll_below_document pref is true.

This commit restores the test that avoids the issue.

Of course, this does not fix the real issue, since for example opening
Tutorial.lyx and jumping to "5.3 Errors!" produces the same unwanted
effect.
2023-07-18 21:03:00 +02:00
Juergen Spitzmueller
649cb30963 Another tiny correction (not yet ideal) 2023-07-18 18:11:59 +02:00
Juergen Spitzmueller
7640d1fbf5 Remove bogus condition and add comments 2023-07-18 17:55:08 +02:00
Juergen Spitzmueller
eadc8ab147 LaTeXHighlighter: handle grouped values with commas in keyval options 2023-07-18 17:35:48 +02:00
Juergen Spitzmueller
9e308ddb03 Improve keyval highlighter 2023-07-18 17:05:56 +02:00
Juergen Spitzmueller
c549a2b59c At end of children, language needs to be reset
This amends 243b0ef90c
2023-07-18 15:27:17 +02:00
Juergen Spitzmueller
6603ae2242 Support option snippets in the LaTeXHighlighter 2023-07-18 15:13:48 +02:00
Kornel Benko
8eda9e25e0 Acount for all non-negative spaces used by lyx
The unicode representation in an ascii-string string is
\302\240                                Normal space
\342\200\257                            Non-breaking Thin (1/6 em)
\342\200\213\342\200\205\342\200\213    Medium(2/9 em)
\342\200\213\342\200\204\342\200\213    Thick (5/18 em)
\342\201\240\342\200\202\342\201\240    Half Quad(0.5 em)
\342\200\203                            Quad(1 em)
\342\200\203\342\200\203                Double Quad(2 em)
\342\220\243                            Visible space

'Double Quad' counts as 2 spaces, all others count as 1 space in the search regex
2023-07-18 13:09:55 +02:00
Juergen Spitzmueller
cd080da3c4 Fix thinspace search regex 2023-07-18 07:28:18 +02:00
Jean-Marc Lasgouttes
430c41cd05 Fix display of comment char in "lyxlex" debug channel 2023-07-17 23:02:46 +02:00
Juergen Spitzmueller
999b95398d THINSPACE is nonbreakable (i.e., 0x202f, not 0x2009) 2023-07-17 17:14:50 +02:00
Juergen Spitzmueller
f6f936e3d0 Support protected and thin space in simple search (#12836) 2023-07-17 16:58:58 +02:00
Juergen Spitzmueller
e87ace901a Style 2023-07-17 16:55:47 +02:00
Juergen Spitzmueller
edaf28fdd6 Do not throw away runparams settings of InsetText in InsetFoot::latex
This amends 243b0ef90c
2023-07-17 13:18:56 +02:00
Jean-Marc Lasgouttes
13d24c711e When breaking a paragraph, do not reset depth
Remove some logic that would reset depth when editing non-environment
stuff (e.g. Standard layout) at non-zero depth. The current way of
decreasing depth is to use paragraph-break in an empty paragraph.

See discussion in ticket #2445 for why this code happened.

Fixes bug #12750.
2023-07-16 17:16:02 +02:00
Stephan Witt
c4195defe6 #12818 amend last change b924db72c5 - use c++ 11 compiler compatible code 2023-07-16 17:11:38 +02:00
Stephan Witt
b924db72c5 #12818 correct evaluation of message box result info
The help page of int QMessageBox::exec() (​https://doc.qt.io/qt-6/qmessagebox.html#exec) says:
When using a QMessageBox with standard buttons, this function returns a StandardButton value indicating the standard button that was clicked.
When using QMessageBox with custom buttons, this function returns an opaque value; use clickedButton() to determine which button was clicked.
2023-07-16 16:49:02 +02:00
Juergen Spitzmueller
b397c78b70 Move comment to where it belongs 2023-07-16 16:46:02 +02:00
Juergen Spitzmueller
243b0ef90c If language needs to be reset at the end of footnotes or floats
then do reset it only after footnotes or floats. \selectlanguage at
the end of environments might produce spurious vertical space
(see https://marc.info/?l=lyx-devel&m=168872369617866)
2023-07-16 16:31:31 +02:00
Jean-Marc Lasgouttes
386a2ddca1 Cache the value of FontMetrics::xHeight()
This value is computed for the metrics of *every* Mathdata and hotspot
says that it counts for 9% of total on math-heavy "branch-test.lyx"
file. I am not sure that real world agrees with that, but profiling
shows that Qt itself does not cache the value.

Part of reinvestigation of #12297.
2023-07-15 23:32:59 +02:00
Jean-Marc Lasgouttes
d8e509e5eb Cleanup and (maybe) speedup InsetMathChar::mathClass
Profiling with hotspot show that it counts for more than it should and
indeed using support::contains is a overkill here. I like the new code
better anyway.

I would be surprised to see that it makes a big difference, though.
2023-07-15 23:29:24 +02:00
Enrico Forestieri
99f972e2c4 Give error if a required Qt6 module is missing
Configure would not stop in such cases and a subsequent make would fail.
2023-07-15 15:28:17 +02:00
Jean-Marc Lasgouttes
582eb7cc03 add comment 2023-07-15 15:20:28 +02:00
Daniel Ramoeller
975115479a Don't add LabelString for Manual LabelType
Fix for bug  #12753
2023-07-14 19:06:40 +02:00
Jean-Marc Lasgouttes
4bbd4a45e7 Fix display of a math hull inset in a tight inset
This is a kind of hack. This allows InsetMathHull to state that it
needs some elbow room beyond its width, in order to fit the numbering
and/or the left margin (with left alignment), which are outside of the
inset itself.

To this end, InsetMathHull::metrics() sets a value in
MetricsInfo::extrawidth and this value is recorded later in the
corresponding row element's `extra' field.

The code could be reorganized to be simpler, in particular by
computing metrics in tokenizeRow, or after tokenizeRow. However the
choice here is to produce a simple patch, fit for 2.4.0.

Fixes bug #12320.
2023-07-14 17:17:23 +02:00
Kornel Benko
bf69b7b3a7 Add 'tab-group-next' to emacs.bind
Theis resembles the shortcut "other-window" in emacs.
(Suggestion comes from Christopher Menzel)
2023-07-07 10:51:51 +02:00
Jean-Marc Lasgouttes
7cc431bd55 Add optional parameter 'local' to outline-in/out
When this parameter is given, only the current paragraph is affected
by the section promoting/demoting.

Note that the new argument is not used yet.

Update release notes and LFUNS documentation.

Part of ticket #12417.
2023-07-06 17:47:08 +02:00
Jean-Marc Lasgouttes
a3db9a667f Outline: swap order of up and down arrows
The order is more natural now.

See discussion in #12809.
2023-07-06 17:47:08 +02:00
Scott Kostyshak
c4cdff5de2 Fix cursor font after collapsing inset (#12830)
If the cursor is in an inset, and it is closed (e.g., with ctrl + i,
or inset-toggle), the cursor is moved outside of the inset, so the
font must be reset.
2023-07-06 08:40:41 -04:00
Pavel Sanda
fb43449c80 Hide multi-keystroke accelerators in Mac menu (bug 12693).
Patch from Juergen.
2023-07-05 20:45:26 +02:00
Daniel Ramoeller
28a9124241 Fix combined zoom widget on windows (bug #12803). 2023-07-04 19:08:51 +02:00
Juergen Spitzmueller
86069c9e9a lyx2lyx: skip mathed in convert_hebrew_parentheses (#12824)
Those have not been swapped in Hebrew.
2023-07-04 07:37:06 +02:00
Pavel Sanda
9d8bef017b Add bug reference. 2023-07-03 23:54:34 +02:00
Juergen Spitzmueller
d5a9699794 Fix inset context menu offset with keyboard (#12811) 2023-07-03 16:28:38 +02:00
Juergen Spitzmueller
94dd5ed6eb Avoid unnecessary cprotect loading (#12826) 2023-06-30 16:31:13 +02:00
Scott Kostyshak
551ede855a Style and whitespace 2023-06-29 05:31:41 -04:00
Enrico Forestieri
befe2da495 Honor pending spaces in InsetMathChar::write
The InsetMathChar::write() method directly accesses the otexrowstream
underlying the TeXMathStream class for writing a character, thus
shortcircuiting the mechanism that allows to separate a macro from the
following material. It has to do so because directly writing a char_type
would cause printing its numerical value instead of the corresponding
unicode character in systems where char_type is typedef'd to uint32_t.

This problem has been uncovered by [7441172d/lyxgit] because each atom
of a mathed cell was being separately written to the output instead of
using the lyx::write() method in MathExtern.cpp that simply converts
everything to a docstring. As InsetMathChar::write() is the only method
bypassing the TeXMathStream machanism, it is simpler teaching it to
honor the pending space instead of modifying the code in InsetMathColor.

This commit amends 7441172d.
2023-06-28 21:17:26 +02:00
Jürgen Spitzmüller
889dac7def Prevent par break caused by \egroup (#12821) 2023-06-28 14:46:46 +02:00
Jean-Marc Lasgouttes
8aea6af6a0 Make outline function work in an inset
The function outline is modified to operate only in the inset that
contains the cursor. This means that the function can be enabled in
insets (this had been forbidden to fix #5004).

Of course, there may be cases where the user expects something to
happen outside of the inset. I am sorry to announce that this is not
going to happen ;)

Fixes bug #12809.
2023-06-27 14:58:27 +02:00
jpc
7d9e29d498 Update fr.po 2023-06-25 17:56:55 +02:00
Enrico Forestieri
c15a9d86f9 Update it.po 2023-06-25 12:23:03 +02:00
Scott Kostyshak
f208f18022 Update tex2lyx tests
Update the test files after the last format change (c3f98d1f).
2023-06-21 15:03:47 -04:00
Jean-Marc Lasgouttes
65b03c7c72 Improve label font computation in insets
This patch reuses the code of TextMetrics::displayFont() that handles
the label part of LABEL_MANUAL paragraphs to create a new
labelDisplayFont() method usable for things like Itemize labels.

To this end, and new magic value is used as position to force the
label case in displayFont(). The code is also factored a bit and
cleaned up.

Fixes bug #12810.
2023-06-21 17:23:34 +02:00
Juergen Spitzmueller
6c4afc1ccb Show full inset context-menu when clicking on text part of collapsible (#10370) 2023-06-20 11:00:13 +02:00
Juergen Spitzmueller
75eb3abcfb typo 2023-06-20 11:00:05 +02:00
Jean-Marc Lasgouttes
b82a7279a8 Comments cleanup 2023-06-20 00:06:57 +02:00
Scott Kostyshak
f14384ff91 Add "override" to fix warning
Otherwise we get the following warning:

src/frontends/qt/InsertTableWidget.h:44:7: error: 'hideEvent' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
        void hideEvent(QHideEvent * event);
             ^

Amends ca5a75b2.
2023-06-19 14:52:45 -04:00
Enrico Forestieri
c5c03f9be3 Amend b135c965
A macro with @ in its name must be used after \makeatletter
2023-06-19 18:30:23 +02:00
Enrico Forestieri
b135c965f6 Use \ifthenelse instead of relying on TeX primitives
This fixes the issue reported here:
https://www.mail-archive.com/lyx-users@lists.lyx.org/msg115156.html
2023-06-19 18:17:31 +02:00