forked from qt-creator/qt-creator
C++: Select All select the symbol while renaming symbol
https://bugreports.qt.nokia.com//browse/QTCREATORBUG-5520 Change-Id: Ifb163adb2609e17cdbc3df1e90b7e583c75fac49 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
committed by
Leandro Melo
parent
d96c1a746e
commit
a138465848
@@ -579,6 +579,27 @@ void CPPEditorWidget::cut()
|
||||
finishRename();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::selectAll()
|
||||
{
|
||||
// if we are currently renaming a symbol
|
||||
// and the cursor is over that symbol, select just that symbol
|
||||
if (m_currentRenameSelection != NoCurrentRenameSelection) {
|
||||
QTextCursor cursor = textCursor();
|
||||
int selectionBegin = m_currentRenameSelectionBegin.position();
|
||||
int selectionEnd = m_currentRenameSelectionEnd.position();
|
||||
|
||||
if (cursor.position() >= selectionBegin
|
||||
&& cursor.position() <= selectionEnd) {
|
||||
cursor.setPosition(selectionBegin);
|
||||
cursor.setPosition(selectionEnd, QTextCursor::KeepAnchor);
|
||||
setTextCursor(cursor);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
BaseTextEditorWidget::selectAll();
|
||||
}
|
||||
|
||||
CppModelManagerInterface *CPPEditorWidget::modelManager() const
|
||||
{
|
||||
return m_modelManager;
|
||||
|
||||
Reference in New Issue
Block a user