forked from qt-creator/qt-creator
Utils: Fix editing in environment widget
In the edge case that the name of one variable starts with the name of another followed by an underscore, we mistakenly stopped at the former when searching for the latter in the text widget. Fixes: QTCREATORBUG-30855 Change-Id: I6decf7805a937d52d25e6c62899ae062f636a2a1 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -142,7 +142,7 @@ bool NameValueItemsWidget::editVariable(const QString &name, Selection selection
|
|||||||
skipWhiteSpace();
|
skipWhiteSpace();
|
||||||
if (offset < line.length()) {
|
if (offset < line.length()) {
|
||||||
QChar nextChar = line.at(offset);
|
QChar nextChar = line.at(offset);
|
||||||
if (nextChar.isLetterOrNumber())
|
if (nextChar.isLetterOrNumber() || nextChar == '_')
|
||||||
continue;
|
continue;
|
||||||
if (nextChar == '=') {
|
if (nextChar == '=') {
|
||||||
if (++offset < line.length() && line.at(offset) == '+')
|
if (++offset < line.length() && line.at(offset) == '+')
|
||||||
|
Reference in New Issue
Block a user