TextEditor: Consider angle brackets as braces too

When performing "surround with brackets" allow this feature for
angle brackets as well.

Change-Id: I4192fd832aa3e692d9287b5b873e9ea31ec2b7e3
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2023-11-14 13:51:52 +01:00
parent 8ae0e3dbf8
commit 5fcf404846

View File

@@ -104,6 +104,8 @@ static QString surroundSelectionWithBrackets(const QString &textToInsert, const
replacement = selection + QLatin1Char(')'); replacement = selection + QLatin1Char(')');
} else if (textToInsert == QLatin1String("[")) { } else if (textToInsert == QLatin1String("[")) {
replacement = selection + QLatin1Char(']'); replacement = selection + QLatin1Char(']');
} else if (textToInsert == QLatin1String("<")) {
replacement = selection + QLatin1Char('>');
} else if (textToInsert == QLatin1String("{")) { } else if (textToInsert == QLatin1String("{")) {
//If the text spans multiple lines, insert on different lines //If the text spans multiple lines, insert on different lines
replacement = selection; replacement = selection;