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.
The change includes a rewrite of the cursor movement when „mac style“ is enabled and don’t change anything otherwise.
The new code for mac uses the document iterator to go forward or backward. The traversal stops at word boundaries.
If going forward the position increments until a word is reached (if not already inside) and stops at the end of the word.
If going backward it does the same in opposite direction. The cursor jumps over non-editable insets and math.
Editable (open) insets are entered and the cursor move detects word boundaries inside them.
The is a fixup to commit 611df441. It seems that the wrong unicode
property was selected. It could be that both classes should be used.
Fixes bug #11900.
These uses are inefficient (a loop really) and require that pit_type
is ptrdiff_t.
Instead, RandomAccesslist::constIterator is renamed to iterator_at and
a version adding a non-const iterator is added. Additionally, the
method retirns end() when position is equal to the size of the
container (see #11861).
lyx::next and lyx::prev are removed, and std::prev is used in the few
places where the code requires it (for no good reason IMO).
These uses are inefficient (a loop really) and require that pit_type
is ptrdiff_t.
Instead, RandomAccesslist::constIterator is renamed to iterator_at and
a version adding a non-const iterator is added.
lyx::next and lyx::prev are removed, and std::prev is used in the few
places where the code requires it (for no good reason IMO).
1/ When inserting an inset over a selection, it makes sense if the
selection covers a complete or several paragraphs to reset the layout of
the paragraph that contains the inset to plain layout. In general the
inner inset will have the needed layout information and it does not
make sense to keep this information outside.
However, when the inset forces plain layout, it does not make sense to
do that and the outer layout is preserved.
Some code that duplicates what is done in pasteSelectionHelper is also
removed.
2/ Similarly, when dissolving an inset, do not reset the layout of the
first paragraph if the inset was alone in its own paragraph.
Note that this does not work as intended when change tracking is enabled.
Fixes bugs #10266 and #10369.
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.
This adds a new (boolean) parameter "active" to the label cache, where
we track whether a label is deleted in ct mode (the same could be done,
if wanted, for labels in notes and inactive branches).
Deleted (inactive) labels are neither considered in the uniqueness check
nor added to the outliner. This also means that undeleted references to
deleted labels are now (correctly) marked as BROKEN.
Fixes: #6563
The part of code that removed space at start of paragraph have been
there forever, but its intent is unclear. For example, cutting text at
the end of a paragraph will lead to remove space at the start of this
same paragraph.
The removal of this functionality is offset by a rewrite of DEPM that
makes it more thorough.
Fixes bug #10503.