The new function word-togglecase is a companion of word-upcase and
word-lowcase: it toggles each character between lowcase and upcase,
which is useful when one FORGOT THE cAPS lOCK KEY.
Add bindings (except for emacs) and a menu entry.
The position of the cursor should not be decreased if it is already at
the start of the paragraph. This can lead to a crash when trying to
display the caret.
Avoids hardcoding of insets, and this behavior is possibly useful to
other insets than index and nomencl
We take this on yesterday's layout format change
The statistics code is known to be very slow, because it relies on
DocIterator to go through the buffer.
This commit introduces a new Statistics class that encapsulates the
main code, along a virtual method Inset::updateStatistics() that
allows to fine-tune how counting is done inset by inset.
This is a faithful bug-for-bug reimplementation.
The new code appears to be 3x faster than the old one.
See bug #12929 for a discussion about statistics update woes.
The recordUndo() call is very wrong, since we may be inserting over a
selection covering several paragraphs (undo itself works at paragraph
granularity).
recordUndoSelection() is the right operation in this case. It is
equivalent to recordUndo() when there is no selection.
Using SinglePar does not majke sense here since the paragraph is not
modified and it might even not have a position yet.
This fixes a crash in BufferView::singleParUpdate, which is not
prepared (yet) to such situations.
Reorder the tests so that, when the flag Update::SinglePar has been
specified, it does not take precedence over Update::Force flag.
This fixes the crash with inset-split.
Commit 5577e877 introduces forceUpdateBuffer() to delay actual
updatBuffer() calls to a central place.
In Cursor::upDownInText, the updateNeeded flag (which triggers
Update::Force update flag) is set to true when Cursor::checkDepm
returns true. This is fine, except that checkDepm also leads to a
forceBufferUpdate() call.
The logic in the method was such that, when updateNeeded is already
true when entering, forceBufferUpdate() will be called even though
checkDepm did not request it.
Fixes a slight delay with selecting in MergedManual (the manual of
manuals).
Annotate function LFUN_FINISHED_xxx to indicate that they do not
require a full metrics computation.
Remove an "optimization" that meant that when the cursor changed
inset, a full metrics computation was requested.
Part of bug #12297
When entering/leaving a math hull inset, a Update::Force flag was set,
in case the metrics of the inset would change because of a switch
between normal and preview representation.
When entering the inset, this code is now used only when the inset was
in preview mode.
In both cases, Update::Force is replaced with Update::SinglePar.
This requites in Text::dispatch to honor Update::SinglePar when it has
been set by some lfun, even when singleparupdate is false.
Part of bug #12297.
The issue here is that macro templates are forbidden in InsetTabular
(why? I do not know) and Text::getStatus does not enforce that
properly. Text::insertInset is called and does nothing (because
insertion is forbidden) and yet the cursor is changed to point into
this non existent inset.
Solution:
1/ block insertion of macro templates when not allowed
2/ (additional safety) when insertion of a math macro inset failed, do
not try to set cursor inside the non-existing inset.
Additionally clarify comments.
The proper way to do word-wise selection is to compute the words
around both the cursor and the anchor.
Note that code is uglier than it should because CursorData::normalAnchor()
returns a CursorSlice instead of a DocIterator.
Fixes bug #12533.
With change tracking on, spaces that are marked as ADDED are really
removed (and not marked deleted) if the changeAuthor is the current
author; see Paragraph::eraseChar().
The function tried to account for that but had the logic upside down.
Consequently actually deleted spaces haven't been counted and the
result was off.
This fixes an assertion when pasting in CT parts with deleted stuff
(#12901)
Instead of just disabling MOUSE_MOTION on inset buttons, we now register
the coordinates where the latest mouse press happens, and if that's on
the inset button we are on when releasing, we toggle the inset.
Thus, minimal unintentional mouse movements don't lead to the button not
to respond.
This allows to restrict the use of flex insets to specific contexts.
Note that this is currently very basis. It only considers immediately
containing insets/layouts and can be surpassed via cut and paste.
The use case that made me finally implement this are macros in covington
that make sense only in specific environments (but also consider \inst
in some article classes)
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.
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.
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.
This is done at the end of the release cycle to avoid backporting issues.
The goal is to simplify development, since it was difficult to guess
in which file a given method could be found.
There is some effect on compilation time, but it is not too bad:
* before merge
lapinot: time make Text.o Text3.o Text2.o
CXX Text.o
CXX Text3.o
CXX Text2.o
real 0m32,504s
user 0m31,027s
sys 0m1,446s
lapinot: rm Text*.o
lapinot: time make -j8 Text.o Text3.o Text2.o
CXX Text.o
CXX Text3.o
CXX Text2.o
real 0m21,282s
user 0m32,661s
sys 0m1,424s
* after merge
lapinot: time make Text.o
CXX Text.o
real 0m26,731s
user 0m25,706s
sys 0m1,020s
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.