Add the possibility to more efficient column selection for large
documents using keyboard shortcuts Alt+Shift+PageUp/PageDown/Home/End.
Change-Id: Iaa2d9aeee587f1317dd82d7fef0b01fd5f5f7a55
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Only follow links under cursor if control was already activated when
pressing the mouse button. This amends
11eea3aae0 which just checks if control is
pressed after releasing the mouse button.
Change-Id: I90d23dd3e5ff63aac7812fad889ad9fb7c052b56
Fixes: QTCREATORBUG-23745
Reviewed-by: Alexis Murzeau <amubtdx@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
It did not center on the text cursor.
- Fix lastVisibleBlockNumber() to return the last block if the editor is
scrolled to the bottom (and there potentially is no block located at the
very bottom edge of the editor widget).
- Fix comparison of block numbers (0-based) with line numbers (1-based)
Change-Id: I21405443bea3533e393a7cf320ded6d47f647949
Reviewed-by: David Schulz <david.schulz@qt.io>
Some include of QPainterPath was removed in Qt, causing errors like:
easingpane\easinggraph.cpp(258): error C2079: 'path' uses undefined class 'QPainterPath'
easingpane\easinggraph.cpp(275): error C2027: use of undefined type 'QPainterPath'
easingpane\easinggraph.cpp(305): error C2664: 'void QPainter::drawPath(const QPainterPath &)': cannot convert argument 1 from 'int'
to 'const QPainterPath &'
easingpane\easinggraph.cpp(305): note: Reason: cannot convert from 'int' to 'const QPainterPath'
easingpane\easinggraph.cpp(305): note: use of undefined type 'QPainterPath'
...
Add the missing include statements.
Change-Id: I4f3383cbcec891a52480a683c9c76ed5deee2b2a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
In 6959618d7b a default indenter was set
on all text editor factories.
Unfortunately some editors, like the C++ editor, set their indenter in
the text document constructor, which would then be overridden by this
default indenter.
For now remove the default indenter again until this is better thought
through.
Partially reverts 6959618d7b.
Change-Id: I8f32e92438883edb6be853fa838b75297347a937
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Simple indentation based on the previous line was already available in
the NormalIndenter class. Merge that up the hierarchy chain into
TextIndenter which is the base for other text-based indenters, and make
that the default indenter for text editor factories.
Text editor factories that don't have a special indenter get at least
basic indentation support for free that way.
Change-Id: Ib977a990f10a99bead82bc8a8348c02a106665f1
Reviewed-by: David Schulz <david.schulz@qt.io>
If the text cursor is visible, but in the bottom area of the editor, it
would be no longer visible after splitting. That makes the probable
"area of interest" vanish from sight.
Check that condition (visible before, but would not be visible
afterwards), and if that is the case center the text cursor in both
resulting editors.
Change-Id: I8c8dccd2d9db439c82d0aca34b8ef99fa97aa48e
Reviewed-by: David Schulz <david.schulz@qt.io>
And when restoring editors in other ways (like from a session).
When splitting, the new editor was always scrolling to make the text
cursor visible, even if it wasn't visible in the original.
1. open editor with long contents
2. scroll away from the text cursor, so the line isn't visible
3. split and wonder
or 3. close and re-open Qt Creator, and restore the session
Our code already does set the state of the new editor to the old one,
but that state was destroyed by QPlainTextEdit::showEvent, which scrolls
on first show if text was added to the document.
So, wrap the showEvent with save/restoreState on first show.
Change-Id: I95e0b4e963ebb33d13ce020affaf7fc7f94c9257
Reviewed-by: David Schulz <david.schulz@qt.io>
The update rect should be identical to the calculated line rect when
repainting the current line highlight. And the offset must not be
calculated into the line rect since we just want to repaint the complete
viewport width.
Fixes: QTCREATORBUG-23647
Change-Id: I0656f0fee4823c8ff55c70b2a4cd69f0183e141d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Also when text is removed via shortcuts.
Fixes: QTCREATORBUG-15038
Change-Id: I1c78b9306594fbf13378a55b27be18769de141a6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
So far it was only possible to combine TextEditorFactory, BaseTextEditor
and TextEditorWidget directly.
That TextEditorWidget is also directly a QPlainTextEdit made it
impossible to "decorate" the text editor widget with something else
without a lot of effort.
Make it possible to create a text editor factory that returns an
arbitrary widget, as long as it can be "cast" to a TextEditorWidget with
either qobject_cast or Aggregation::query. That way the TextEditorWidget
instance can be attached to the editor widget via Aggregation.
Adapt other code that accesses TextEditorWidget from editors
accordingly. Introduce a common method how to do that.
Change-Id: I72b8721f3a8a8d8281c39af75253e9c80cbe1250
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
... in TextEditorFactory explicitly. Plan is to remove the QObject
inheritance of the factory, so it can't serve as a parent anymore.
Change-Id: I7bad358b5d150c695befc7ad4afcf7c2be7fd248
Reviewed-by: David Schulz <david.schulz@qt.io>
Also, replace or remove unneeded Q_OBJECTs, and make base
setters and adders protected.
Change-Id: I212257ef53984d8852dc8c478537199fc9483486
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
We can't just add widgets after the first action of the toolbar.
The first action might not have a widget and will assert for that reason
in Qt.
Change-Id: Ib69c7d6d91bd56f25023aaebf961fef15cdcf008
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
If the cursor is positioned at a word boundary the action behaves
incorrect. Copy the behavior of QWidgetTextControlPrivate::keyPressEvent
which feels more natural.
Fixes: QTCREATORBUG-8977
Fixes: QTCREATORBUG-7056
Change-Id: I9dc0102023bb6234dcfa82619a976c723bc37a05
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Renaming the auto indent function triggered by Ctrl+I to make room
for a real format action.
Change-Id: If5731353311030d66a20f1093a7fdd300703ebbc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This avoids showing the option for example in git log or blame views.
The user also should not be able to actually change the line ending
style of read-only editors.
Fixes: QTCREATORBUG-23276
Change-Id: Ifa5cc9f663539928b4d5422b020e348b439684fa
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Marius Sincovici <smaryus@gmail.com>
The link is updated on the release anyway. Reset the press state of
the link now after a mouse move event.
Fixes: QTCREATORBUG-21848
Change-Id: Ice7a9873b1635a1b59ba7b8f2a266bf14e28c112
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
And use that in the Include and Type Hierarchy
panels to allow resizing the panels smaller.
Fixes: QTCREATORBUG-23197
Change-Id: Ia4b39e610c7a4be4df564dc69573f4748d7634a5
Reviewed-by: David Schulz <david.schulz@qt.io>
If the paint event rect does not contain the complete line, request an
update with the full line width also for editable editors. This fixes
current line highlight issues in the commit reword editor.
Change-Id: I6b93230a47bdd61248c1aa9631208606cbbae7c8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Check whether an editor already contains the hover handler before adding
to the list of handlers. Also remove the handler when a document is
deactivated for a specific client.
Change-Id: Iec1d3a0fd1dc3f02c8dd50b8968ff063efe2508a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
We should not force the tool tip text to HTML when help content is
available or when adding the F1 icon.
Instead add help content and F1 icon into the tool tip layout.
Change-Id: Ibe2d4fa2fb81bcda4e5aeb0d7d86dbf63fcf3ce6
Reviewed-by: David Schulz <david.schulz@qt.io>
Instead of just the editor with the info bar that was triggering the
download action or none editor if the action was triggered from the
settings dialog.
Change-Id: I4158eeb7fdb0a763d082c6d801b400e8635c7f38
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
by renaming it to Download Definitions and adding a tooltip stating that it
collects all definitions that are missing or were updated after the release and
downloads it to the ksyntax highlighting user folder.
Also adding a separate reload definitions button in the settings behind
the user path.
Change-Id: I059cc98e33147cae910fa4fdb35631d1dca81448
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
see QWidgetTextControl::processEvent and
QInputControl::isCommonTextEditShortcut. This will break assigning
shortcuts to for example Shift+a.
Change-Id: I4f97c27a47e2a7a44bf06b3ca949a6de74d4bb64
Fixes: QTCREATORBUG-22854
Reviewed-by: Eike Ziller <eike.ziller@qt.io>