mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-05 17:09:56 +00:00
Fix limiting of absurdly large input to thesaurus (#10528)
This commit is contained in:
parent
64095a0af2
commit
2b7fae04f3
@ -2670,8 +2670,16 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
docstring arg = cmd.argument();
|
docstring arg = cmd.argument();
|
||||||
if (arg.empty()) {
|
if (arg.empty()) {
|
||||||
arg = cur.selectionAsString(false);
|
arg = cur.selectionAsString(false);
|
||||||
// FIXME
|
// Too large. We unselect if needed and try to get
|
||||||
|
// the first word in selection or under cursor
|
||||||
if (arg.size() > 100 || arg.empty()) {
|
if (arg.size() > 100 || arg.empty()) {
|
||||||
|
if (cur.selection()) {
|
||||||
|
DocIterator selbeg = cur.selectionBegin();
|
||||||
|
cur.selection(false);
|
||||||
|
cur.clearSelection();
|
||||||
|
setCursorIntern(cur, selbeg.pit(), selbeg.pos());
|
||||||
|
cur.screenUpdateFlags(Update::Force);
|
||||||
|
}
|
||||||
// Get word or selection
|
// Get word or selection
|
||||||
selectWordWhenUnderCursor(cur, WHOLE_WORD);
|
selectWordWhenUnderCursor(cur, WHOLE_WORD);
|
||||||
arg = cur.selectionAsString(false);
|
arg = cur.selectionAsString(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user