Add an action to select the word under the cursor (#3633)
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Unversioned
|
## 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: Make animated emote playback speed match browser (Firefox and Chrome) behaviour. (#3506)
|
||||||
- Minor: Added middle click split to open in browser (#3356)
|
- Minor: Added middle click split to open in browser (#3356)
|
||||||
- Minor: Added new search predicate to filter for messages matching a regex (#3282)
|
- 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"}},
|
ActionDefinition{"Choose previously sent message"}},
|
||||||
{"redo", ActionDefinition{"Redo"}},
|
{"redo", ActionDefinition{"Redo"}},
|
||||||
{"selectAll", ActionDefinition{"Select all"}},
|
{"selectAll", ActionDefinition{"Select all"}},
|
||||||
|
{"selectWord", ActionDefinition{"Select word"}},
|
||||||
{"sendMessage",
|
{"sendMessage",
|
||||||
ActionDefinition{
|
ActionDefinition{
|
||||||
"Send message",
|
"Send message",
|
||||||
|
|||||||
@@ -456,6 +456,13 @@ void SplitInput::addShortcuts()
|
|||||||
this->ui_.textEdit->selectAll();
|
this->ui_.textEdit->selectAll();
|
||||||
return "";
|
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(
|
this->shortcuts_ = getApp()->hotkeys->shortcutsForCategory(
|
||||||
|
|||||||
Reference in New Issue
Block a user