forked from mia/Aegisub
Select the last token when double-clicking past the end of the text in the edit box
This commit is contained in:
parent
790d52b113
commit
961e6dab88
1 changed files with 12 additions and 5 deletions
|
@ -373,11 +373,18 @@ void SubsTextEditCtrl::OnContextMenu(wxContextMenuEvent &event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubsTextEditCtrl::OnDoubleClick(wxStyledTextEvent &evt) {
|
void SubsTextEditCtrl::OnDoubleClick(wxStyledTextEvent &evt) {
|
||||||
auto bounds = GetBoundsOfWordAtPosition(evt.GetPosition());
|
int pos = evt.GetPosition();
|
||||||
if (bounds.second != 0)
|
if (pos == -1 && !tokenized_line.empty()) {
|
||||||
SetSelection(bounds.first, bounds.first + bounds.second);
|
auto tok = tokenized_line.back();
|
||||||
else
|
SetSelection(line_text.size() - tok.length, line_text.size());
|
||||||
evt.Skip();
|
}
|
||||||
|
else {
|
||||||
|
auto bounds = GetBoundsOfWordAtPosition(evt.GetPosition());
|
||||||
|
if (bounds.second != 0)
|
||||||
|
SetSelection(bounds.first, bounds.first + bounds.second);
|
||||||
|
else
|
||||||
|
evt.Skip();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubsTextEditCtrl::AddSpellCheckerEntries(wxMenu &menu) {
|
void SubsTextEditCtrl::AddSpellCheckerEntries(wxMenu &menu) {
|
||||||
|
|
Loading…
Reference in a new issue