| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QTextDocument had no way of storing the cursor position from which
a document change was initiated in the undo stack. That means that
any undo operation would reposition the text cursor to the text
position where the actual change happened. This works in many cases,
but not always.
In Qt Creator we have standard IDE shortcuts like e.g.
Ctrl+Return for InsertLineBelowCurrentLine, which insert a newline
at the end of the current line, not at the cursor position. Using
undo there resulted in a surprisingly wrong cursor position.
The problem becomes worse with more advanced refactoring and
productivity tools (like snippets).
The patch creates a synthetic CursorMoved undo item with the position
which was current at the time of calling QTextCursor::beginEditBlock(),
but only if necesary, i.e. only in those cases where the cursor would
be positioned wrongly.
Reviewed-by: Roberto Raggi
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Defines whether the cursor should keep its position when
text gets inserted at the current position of the cursor.
For example, we don't want QTextCursor to extend the selection
when inserting characters at the end of an extra selection
representing a user-type but we do want the selection to grow
when rewriting a region of code (e.g. when using our QuickFix engine).
Task-number: QTBUG-11075
Reviewed-by: mae
|
|
|
|
|
|
|
|
|
|
|
| |
When doing block undo operations, QTextDocument used the change
position of the last undo command for positioning the cursor.
This is incorrect if the last commands are of type
QTextUndoCommand::Removed but split because of the text
fragments. The bug is highly noticable in creator when
inserting snippets and doing undo afterwards.
The change adds an auto test.
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
| |
Block changes in different selections happens quite frequently with
Qt Creator, e.g. when renaming local variables. This test tests the
desired cursor position behaviour: after an undo, the cursor should be
where it was when the block operation started. After a redo, the cursor
should be where it was after the block operation ended.
|
|
|
|
|
|
|
|
|
| |
The change makes QTextCursor not extend the selection when inserting
characters at the end of the selection, provided that the cursor
position is at the end.
Reviewed-by: Simon Hausmann
Reviewed-by: Roberto Raggi
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
| |
Each version of Qt has its own set of autotests, therefore
preprocessor directives relating to obsolete QT_VERSION's
are not necessary.
Reviewed-by: Carlos Duclos
|
|
|