mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-27 03:36:39 +00:00
Fix this bug:
1. scroll a bit so that the cursor is not visible anymore 2. hit the keyboard arrow keys to move the cursor or type something The problem was that TextMetrics::parMetric() automatically creates a new parmetrics on const access. This was needed in the old architecture but I don't think anymore. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23126 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
38a1df7cd4
commit
6564e9bb4e
@ -406,10 +406,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
// Signals that a full-screen update is required
|
||||
bool needsUpdate = !(lyxaction.funcHasFlag(cmd.action,
|
||||
LyXAction::NoUpdate) || singleParUpdate);
|
||||
// Remember the old paragraph metric (_outer_ paragraph!)
|
||||
ParagraphMetrics const & pm = cur.bv().parMetrics(
|
||||
cur.bottom().text(), cur.bottom().pit());
|
||||
Dimension olddim = pm.dim();
|
||||
|
||||
switch (cmd.action) {
|
||||
|
||||
@ -1820,16 +1816,11 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
// FIXME: the following code should go in favor of fine grained
|
||||
// update flag treatment.
|
||||
if (singleParUpdate) {
|
||||
// Inserting characters does not change par height
|
||||
ParagraphMetrics const & pms
|
||||
= cur.bv().parMetrics(cur.bottom().text(), cur.bottom().pit());
|
||||
if (pms.dim().height() == olddim.height()) {
|
||||
// if so, update _only_ this paragraph
|
||||
cur.updateFlags(Update::SinglePar |
|
||||
Update::FitCursor);
|
||||
return;
|
||||
}
|
||||
needsUpdate = true;
|
||||
// Inserting characters does not change par height in general. So, try
|
||||
// to update _only_ this paragraph. BufferView will detect if a full
|
||||
// metrics update is needed anyway.
|
||||
cur.updateFlags(Update::SinglePar | Update::FitCursor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!needsUpdate
|
||||
|
Loading…
Reference in New Issue
Block a user