Fixup 2bdd691130: remove two more Update::SinglePar instances

They do not do what the author(s) of these lines thought it would do,
and can create crashes.
This commit is contained in:
Jean-Marc Lasgouttes 2024-07-20 17:12:09 +02:00
parent 0f5f80e0ba
commit 485f5afc21

View File

@ -5267,7 +5267,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
// Set the cursor // Set the cursor
bvcur.resetAnchor(); bvcur.resetAnchor();
if (!bv->mouseSetCursor(cur, cmd.modifier() == ShiftModifier)) if (!bv->mouseSetCursor(cur, cmd.modifier() == ShiftModifier))
cur.screenUpdateFlags(Update::SinglePar | Update::FitCursor); cur.screenUpdateFlags(Update::FitCursor);
// FIXME: move this to mouseSetCursor? // FIXME: move this to mouseSetCursor?
if (bvcur.wordSelection() && bvcur.inTexted()) if (bvcur.wordSelection() && bvcur.inTexted())
expandWordSel(bvcur); expandWordSel(bvcur);
@ -5366,9 +5366,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
// selectWord but bvcur is current // selectWord but bvcur is current
// mouse position. // mouse position.
cur.bv().cursor().setSelection(); cur.bv().cursor().setSelection();
// We might have removed an empty but drawn selection cur.screenUpdateFlags(Update::FitCursor);
// (probably a margin)
cur.screenUpdateFlags(Update::SinglePar | Update::FitCursor);
} else } else
cur.noScreenUpdate(); cur.noScreenUpdate();
// FIXME: We could try to handle drag and drop of selection here. // FIXME: We could try to handle drag and drop of selection here.