mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Add an action to select the word under the cursor (#3633)
This commit is contained in:
parent
8f156298af
commit
29117a930e
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Unversioned
|
||||
|
||||
- Major: Added customizable shortcuts. (#2340)
|
||||
- Major: Added customizable shortcuts. (#2340, #3633)
|
||||
- Minor: Make animated emote playback speed match browser (Firefox and Chrome) behaviour. (#3506)
|
||||
- Minor: Added middle click split to open in browser (#3356)
|
||||
- Minor: Added new search predicate to filter for messages matching a regex (#3282)
|
||||
|
|
|
@ -135,6 +135,7 @@ inline const std::map<HotkeyCategory, ActionDefinitionMap> actionNames{
|
|||
ActionDefinition{"Choose previously sent message"}},
|
||||
{"redo", ActionDefinition{"Redo"}},
|
||||
{"selectAll", ActionDefinition{"Select all"}},
|
||||
{"selectWord", ActionDefinition{"Select word"}},
|
||||
{"sendMessage",
|
||||
ActionDefinition{
|
||||
"Send message",
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue