Add an action to select the word under the cursor (#3633)

This commit is contained in:
Mm2PL
2022-03-27 11:33:44 +00:00
committed by GitHub
parent 8f156298af
commit 29117a930e
3 changed files with 9 additions and 1 deletions
+7
View File
@@ -456,6 +456,13 @@ void SplitInput::addShortcuts()
this->ui_.textEdit->selectAll();
return "";
}},
{"selectWord",
[this](std::vector<QString>) -> QString {
auto cursor = this->ui_.textEdit->textCursor();
cursor.select(QTextCursor::WordUnderCursor);
this->ui_.textEdit->setTextCursor(cursor);
return "";
}},
};
this->shortcuts_ = getApp()->hotkeys->shortcutsForCategory(