There is no need to have an extra file for one struct that is only used
inside texteditor.cpp
Change-Id: Iee8f7ce5e0d19da7b444660d81c350eb10b501ef
Reviewed-by: hjk <hjk@qt.io>
Since Qt 6.5.1 QPlainTextEdit::selectAll emits correctly
cursorPositionChanged on selectAll which calls some multitextcursor
update code on our side. Avoid setting the cursor back to the
QPlainTextEdit in this update code by setting the expected
MultiTextCursor before calling selectAll.
Fixes: QTCREATORBUG-29763
Change-Id: I77f05ac40a9dd126efcd72089a699c908c68da21
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Avoid creating QTextCursors for checking whether a search result is
inside the find scope. QTextCursor::setPosition seems to layout the
block the cursor is positioned at, which is not for free and not needed
to verify whether a search result is inside the find scope.
Change-Id: Ia1658fbbaa89a61f862e0b97eaa5b059972e2311
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Allow to follow to the symbol definition as well as to the type
definition for the symbol under the cursor position.
Change-Id: I8ff50b33a1e739f81b0832b1b28ffc525e1f7177
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Like for the line number label: Having a button instead of a labal makes
it more obvious that there is an action triggered when clicking the
label.
Change-Id: Ied15c05658c0b0b7df75cbcf1704808e94f6985d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Having a button instead of a labal makes it more obvious that there is
an action triggered when clicking the label.
Also fix the flickering introduced by
f0bb7e8bfa by saving the maximum width of
the sizeHint. Since the width can get big if we have a selection we do
not save the size in that case to avoid blocking the width when the
selection is removed again.
Change-Id: If8210ecbabb8c6449c4f88652fbed99f8526057d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
In 8e118e9d5e, we stopped re-wrapping in
comments when a doxygen/qdoc command appeared at the start of the line.
However, there are also "inline" commands such as \l and \c that can by
chance appear on the start of a line and should not stop rewrapping.
Since we are still quite reluctant to enumerate and categorize the
countless doxygen/qdoc commands, let's just ignore all one-letter
commands for rewrapping purposes.
(Yes, this is another hacky heuristic.)
Fixes: QTCREATORBUG-28761
Change-Id: I40d77706851ec24504d6fd8795906dd55249661d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This change contains various adjustments to the line column label:
- Display the number of selected characters
- Show the number of cursors instead of the position when multiple text
cursors are present in the current editor
- show detailed information for each cursor in the line column tooltip
Fixes: QTCREATORBUG-29381
Change-Id: Ib4f36b290797f1d84f268deeb9556e78ae921c37
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Looking up the last visible block is not for free since it calculates
the bounding rects for all blocks between the first and last visible
block. Avoid one calculation by postponing the annotation cleanup after
the paint event and only if we reach a certain amount of cached entries.
Change-Id: Ibfab49301f82237e16d5a69ce1531539907e7ed8
Reviewed-by: hjk <hjk@qt.io>
Introduce and make use of Utils::insert() for QSet with a return value
that indicates whether insertion actually happened.
Change-Id: I655e4bc3553b74fea5ae8956205e4d8070118d63
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
emitting requestBlockUpdate is not for free so limitting it to blocks
that have changed improve the performance notable for documents with a
lot of refactoring markers.
Change-Id: Ie288a367d1d1d6a9f4359e37ff8486a1dfe36752
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Avoid asking the indenter for the visual indent depth since some
implementations are not cheap and might even cause file io. Fall back to
the default detection.
Change-Id: Ic85d134fc29a0599768ac05c306b8593e83db327
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
It's going to be reused in filesearch.h API.
Change-Id: I7ef133368536a647e19949ba8623134cf078a87d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Use SearchResultItem instead.
This change should reduce the remaining freeze described in
a9eb732ce6 even more.
Change-Id: I102b82ed5677360ccd9e425dd0bdd941d87116f0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Block suggestions when FakeVim is enabled and the mode
is not "Insert" or "Replace".
Change-Id: I778eb25d9570b76e42652f9d938a8c580033c462
Reviewed-by: David Schulz <david.schulz@qt.io>
The concept of the transient scrollbar still exists, but all used cases
are removed.
Task-number: QDS-9735
Change-Id: I16c57635a5eeb114b906ab74bbf24a8693897557
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Lifetime extension via const-ref only applies to functions that return
by value. For those that already return by reference (such as
QList::constLast()), no extension happens and we end up with a dangling
reference.
cmakebuildconfiguration.cpp:1473:25: warning: possibly dangling reference to a temporary [-Wdangling-reference]
cmakebuildconfiguration.cpp:1473:61: note: the temporary was destroyed at the end of the full expression ‘ProjectExplorer::BuildStepList::steps() const().QList<ProjectExplorer::BuildStep*>::constLast()’
Change-Id: I3b169860d8bd41e9be6bfffd1757167b7348be9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Because the type is always a BaseTextEditor we can return a
BaseTextEditor type. C++ is allowing to change the overload return type
so long it is compatible.
Change-Id: Ib4c88faaa6fdfb97fd03c51a120de0fa0c2d00cd
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
- Transient scroll bar is available for StudioStyle.
- Some changes are applied to slider style, because scrollBar and
sliders have some common usages within the style.
Task-number: QDS-9283
Change-Id: I7a8b7997cf4d20142a0524c4a071b93dfd06321d
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>