Editor: multi cursor support

Adding a way to create multiple cursors that can insert/remove text at
arbitrary positions in the document. Adding cursors is done by pressing
alt + up/down or by clicking into the editor while holding the alt key.

Fixes: QTCREATORBUG-16013
Change-Id: I495d27d95a3d277220946616ef30efc241da0120
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
David Schulz
2021-06-28 09:13:57 +02:00
parent eefb385918
commit c00330f905
30 changed files with 2204 additions and 2459 deletions

View File

@@ -337,6 +337,9 @@ static bool trySplitComment(TextEditor::TextEditorWidget *editorWidget,
if (!settings.m_enableDoxygen && !settings.m_leadingAsterisks)
return false;
if (editorWidget->multiTextCursor().hasMultipleCursors())
return false;
QTextCursor cursor = editorWidget->textCursor();
if (!CPlusPlus::MatchingText::isInCommentHelper(cursor))
return false;