Disable the arguments append-column and delete-column of tabular-features.
The code is taken from InsetMathCases, with some changes
* no need to record undo here
* in dispatch, return is prefered to break, since we do not want to invoke
InsetMathGrid::doDispatch.
Propagate these changes to InsetMathCases.
Cleanup of the InsetMathCases error messages to fit with other parts
of the code.
The handling of tabular-features in mathed needs to be unified somehow.
Based on a commit from lynx <lorenzobertini97@gmail.com>
Part of bug #12590.
Backslashes are not allowed in macro names and LyX
enforces this by not allowing entering them by keyboard.
However, it was possible to paste them and this may cause
crashes (see bug #12596).
Being able to insert completion in a read-only document is definitely
a bad idea.
This patch acts both on indication of completion and on insertion
itself.
Fixes bug #12582.
I mathed, undo should record the underlying inset on completion,
whereas in test recording the paragraph is enough.
Therefore the recordUndo() in GuiCompleter::tab is removed, and the
relevant recordUndo/recordUndoInset are used at the right places.
As a further cleanup, the parameter `finished' of
Text::insertCompletion is removed as it is useless.
Fixes bug #12581.
This amends [4a7a1935/lyxgit]. Before 4a7a1935 it was assumed
that a labeled row was also numbered. Hence, when unnumbering
a row a label was also deleted. We now have to do this explicitly.
This code was triggering the following warnings:
src/mathed/InsetMathHull.cpp:234:15: error: variable 'counters_to_save' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
const char * counters_to_save[] = {"section", "chapter"};
^
src/mathed/InsetMathHull.cpp:235:21: error: unused variable 'numcnts' [-Werror,-Wunused-const-variable]
unsigned int const numcnts = sizeof(counters_to_save)/sizeof(char *);
The original code was put in at 645f9fdf (and the comment at 8a226ec4).
This commit amends a65e12d6.
Time will tell whether this is too expensive (because most equations
after this on will change too, unless equations are numbered by
section).
Related to bug #11535.
This patch simplifies and fixes the generation of previews with
numbering. Instead of saving the counter values (which is complicated
and error prone), the \thequation macro is set to the numbers_ string
which has been computed by updateBuffer for screen display.
Harcoding the number in the formula means that two equations with
different numbers have different previews, which is the subject of the
bug.
The special code for saving counters in updateBuffer and outputing
them in preparePreview from 645f9fdf (ticket #6894) is removed and
replaced by this simpler approach.
This fixes ticket #11535.
This patch simplifies and fixes the generation of previews with
numbering. Instead of saving the counter values (which is complicated
and error prone), the \thequation macro is set to the numbers_ string
which has been computed by updateBuffer for screen display.
Harcoding the number in the formula means that two equations with
different numbers have different previews, which is the subject of the
bug.
The special code for saving counters in updateBuffer and putputing
them in preparePreview from 645f9fdf (ticket #6894) is removed and
replaced by this simpler approach.
This fixes ticket #11535.
In mathed it is assumed that a labeled line is also implicitly numbered.
However, latex allows to label an equation without numbering it.
The label is then assigned the value of a nearby numbered one.
This commit drops the above mathed assumption in order to allow to import
valid latex code with a labeled but not numbered equation line.
The screen representation omits the line number and encloses the label
in square brackets for further differentiation. However, it is still not
possible to label an equation without numbering it using the GUI.
Using the new inline statements
find_effective(), find_with_non_output(), find_with_deleted(),
find_set_feature(), find_add_feature() and find_clean_features()
makes the code a slightly better readable.
Wrong behaviour before this commit:
Open new lyx-file
insert
unicode-insert 0x025c 0x1d08
Open adv-find dialog
search for unicode 0x025c OK
search for unicode 0x1d08 OK
search with regex for unicode 0x025c OK
search with regex for unicode 0x1d08 ==> NOT OK (because we are searching for \textrevepsilon
and this was mapped to 0x025c
Fixes bug reported here:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg217265.html
1. Start a new document.
2. Start a math inset and inside put "1+2".
3. Put the cursor to the right of "+".
4. Press <Shift> + L three times. This will select the entire math inset
(as expected).
5. Press <Shift> + R.
Before 503c7c16, the selection inside the math inset was preserved.
After 503c7c16, it is lost.
The problem is that InsetMathNest does too much for our needs and
resets the anchor (why, I do not know). Therefore, it is better to
duplicate the code.
Move the enum definition RowFlags in its own include file, to avoid
loading Inset.h. Document it more thoroughly.
Rename RowAfter to AlwaysBreakAfter.
Add CanBreakInside (rows that can be themselves broken). This allow to
differentiate elements before bodyPos() and allows to remove a
parameter to shortenIfNeeded().
Make the Inset::rowFlags() method return int instead of RowFlags, as
should be done for all the bitwise flags. Remove the hand-made bitwise
operators.
Set R::E::row_flags when creating elements.
* INSET elements use the inset's rowFLags();
* virtual element forbid breaking before them, and inherit the *After
flags from the previous element of the row;
* STRING elements usr CanBreakInside, except before bodyPos.
More stuff may be added later.
When inserting € in a math cell, it is put in a text inset and the
cursor leaves the inset. However, inserting ¤ then leads to
\text{€}\text{¤}.
Therefore, try to see if there is a previous \text inset that can be
recycled and insert the new inset there in this case, leading to
\text{€¤}.
Fixes bug #11979.
Clang 12 (at least) misses the fact that tag is always initialized,
because the if/else sequence does cover all cases.
Initialize the variable although it is not required. It does not hurt
at least.