Commit Graph

9 Commits

Author SHA1 Message Date
Christian Kandeler
13f40f5471 Utils: Add sorted() function
For simpler calling code.

Change-Id: Ia0a16a28770fd172f74d06a626148248bf5d3c0c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-25 14:29:45 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
David Schulz
3f9c1d5d2b Editor: fix selecting multiple block selections with mouse
Change-Id: I5b46adbf38358d1396ee7120558648b1375e4047
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-04-20 07:45:12 +00:00
David Schulz
28e0a957c5 Editor: avoid duplicated line endings inbetween multiple cursors
Change-Id: Ia1721837efef47d570faa4e393b6b0b372944735
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-11 09:16:24 +00:00
David Schulz
e0c115fb9b Editor: Allow creating block selections with alt+shift again
These block selections are a convenience for people used to the block
selection allowing to also unselect parts again (at least as long as
alt+shift is pressed).

Fixes: QTCREATORBUG-26535
Fixes: QTCREATORBUG-26529
Change-Id: I19558dc1d823c268cc1cfda0ea8151bac483701f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-11-08 08:35:38 +00:00
David Schulz
b272d441cb Utils: disable multi cursor add keyboard shortcuts on macOS
They work inconsistently and interfere with system shortcuts

Change-Id: Ibd85483904144ca697bb372746c7999299b7b1f8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-11-02 12:41:39 +00:00
David Schulz
4ecb6a9dc0 Utils: Allow combining add multi cursor events with shift
The old block selection shortcuts were used with alt + shift + up/down,
but the new multi text cursor were just expecting alt + direction key
for adding new cursors. In order to not break with habbits also ignore
shift modifier when checking for alt + cursor move key events.

Fixes: QTCREATORBUG-26503
Change-Id: I064e666a04b88c3b90d10ea35688613159f7d4a5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-11-02 08:31:14 +00:00
David Schulz
b59c374217 Utils: sort the cursor before copying or inserting text
The user shouldn't care about the order of the individual cursors inside
the MultiTextCursor, so the order of selected texts should always be the
same as in the document.

Fixes: QTCREATORBUG-26494
Change-Id: I0d5199bda4e48f8482e20018b8f05020e16da3f6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-10-28 13:26:27 +00:00
David Schulz
c00330f905 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>
2021-09-27 10:56:54 +00:00