Skip to content
Snippets Groups Projects
Commit 6327ee7f authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Check the `word' under cursor when renaming.

parent 6855cb3e
No related merge requests found
...@@ -658,9 +658,13 @@ void ScriptEditor::contextMenuEvent(QContextMenuEvent *e) ...@@ -658,9 +658,13 @@ void ScriptEditor::contextMenuEvent(QContextMenuEvent *e)
menu->addAction(action); menu->addAction(action);
} }
menu->addSeparator(); const QString id = wordUnderCursor();
QAction *a = menu->addAction(tr("Rename '%1'...").arg(wordUnderCursor())); const QList<AST::SourceLocation> &locations = m_ids.value(id);
connect(a, SIGNAL(triggered()), this, SLOT(renameIdUnderCursor())); if (! locations.isEmpty()) {
menu->addSeparator();
QAction *a = menu->addAction(tr("Rename '%1'...").arg(wordUnderCursor()));
connect(a, SIGNAL(triggered()), this, SLOT(renameIdUnderCursor()));
}
menu->exec(e->globalPos()); menu->exec(e->globalPos());
delete menu; delete menu;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment