http://bugzilla.lyx.org/show_bug.cgi?id=5173
* Undo.cpp (beginUndoGroup, endUndoGroup): new methods.
(UndoElement): add group_id member
(UndoElementStack): when removing old undo entries, make sure to
remove whole groups.
(Undo::Private): add group_id and group_level (for nesting) members.
(doTextUndoOrRedo): new method. Apply _one_ UndoElement.
(textUndoOrRedo): call doTextUndoOrRedo on each element of the current
group.
(recordUndoFullDocument): put inside an undo group
* Cursor.cpp (beginUndoGroup, endUndoGroup): new methods.
* LyXFunc.cpp (dispatch): add calls to (begin|end)UndoGroup.
* lyxfind.cpp (replaceAll): use several recordUndo instead
of one recordUndoFullDocument.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26178 a592a061-630c-0410-9148-cb99ea01b6c8
Specifically, moved the functions which actually move left or right from Text
into Cursor, and changed the semantics so that they now return whether or not
the cursor has moved. The functions in Text now use the new functions in Cursor.
This change is being made in preparation of the Word-level visual movement.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24601 a592a061-630c-0410-9148-cb99ea01b6c8
places, i.e.
- BufferView::setMouseCursor,
- BufferView::mouseEventDispatch
- LyXFunc::dispatch
Before it was called from several dispatch handlers in the middle of the
dispatch process. Because the cursor might get invalidated, this is
not a good idea. We had plenty of crashes and odd behaviours because
of this as nobody really understood those cases.
This fixes (at least) #2069 and #4163.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23140 a592a061-630c-0410-9148-cb99ea01b6c8
* completion support for mathed
* experimental completion support for text
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23104 a592a061-630c-0410-9148-cb99ea01b6c8
in any case does not make sense. It's not an index in the sense of DocIterator.
* cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22908 a592a061-630c-0410-9148-cb99ea01b6c8
avoidable ~5% overhead when loading the UserGuide. This is an attempt on
rectifying the situation.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22532 a592a061-630c-0410-9148-cb99ea01b6c8
"The idea of the beforeDispX/Y_ variables in the Cursor is to hold the position
of the cursor on screen before the lyxfunc is dispatched. But to get this the
metrics must be valid. It's updated in Cursor::dispatch before the dispatch
loop.
After inserting/deleting stuff (like when deleting the selected text before
inserting the alpha) the metrics are invalid. But the handler for the alpha
calls Cursor::dispatch after the deletion and hence the crash with your second
patch.
Here is a patch fixing that:
The beforeDispatchXY variable do not belong into the Cursor::dispatch because
Cursor::dispatch is often called "manually" by many handlers to some followup
action. So this logic must go somewhere else where it is sure that is not
updated after the metrics got invalidated."
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22193 a592a061-630c-0410-9148-cb99ea01b6c8
In the future, when Cursor has been fixed to work correctly with multiple views of the same Buffer, we could transfer the Undo owner from Buffer to Cursor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21031 a592a061-630c-0410-9148-cb99ea01b6c8
up/down to tell the insets that the cursor left them. The
notifyCursorLeaves methods can set updateFlags to trigger a redraw.
* leave mathed with cursor up/down and get the math redrawn for the
decorations
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18773 a592a061-630c-0410-9148-cb99ea01b6c8
dispatchers in mathed and text only do local work, i.e. only try to
move the cursor with their local knowledge, not globally as before in
the Cursor::goUpDown function before. The old approach used one of
brutefind functions as a last way out to really move the cursor up or
down. The result was some strange behavior that the nearest inset was
selected when jumping from math to text, not one in the next line.
2. removed LFUN_FINISHED_UP/DOWN, as there seem to be no effect and it
seems to be obsolete.
3. target_x is working again, mainly by adding a textTargetOffset_
member to the Cursor which keeps the difference between the target_x
and the actual position of the cursor on screen. As long as
pos+offset=target is fulfilled the target_x is not touched and the
cursor keep the column while going up/down.
4. moved the text cursor up/down code to the Cursor class, in analogy
to the mathed code.
5. For 1 it is necessary to know the cursor position before the
dispatch. So this data is added to the Cursor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18569 a592a061-630c-0410-9148-cb99ea01b6c8