support displaying completions from editor context menu

This commit is contained in:
Axel Kohlmeyer
2023-09-02 10:48:36 -04:00
parent 98b803eba9
commit cf9ce0ebed
3 changed files with 7 additions and 1 deletions

View File

@ -502,9 +502,14 @@ void CodeEditor::contextMenuEvent(QContextMenuEvent *event)
// print augmented context menu if an entry was found
auto *menu = createStandardContextMenu();
menu->addSeparator();
auto action = menu->addAction(QString("Display available completions").arg(help));
action->setIcon(QIcon(":/expand-text.png"));
connect(action, &QAction::triggered, this, &CodeEditor::runCompletion);
if (!page.isEmpty()) {
menu->addSeparator();
auto action = menu->addAction(QString("Reformat '%1' command").arg(help));
action = menu->addAction(QString("Reformat '%1' command").arg(help));
action->setIcon(QIcon(":/format-indent-less-3.png"));
connect(action, &QAction::triggered, this, &CodeEditor::reformatCurrentLine);