anchor_pit_(0), anchor_ypos_(0),
inlineCompletionUniqueChars_(0),
last_inset_(0), mouse_position_cache_(),
- bookmark_edit_position_(0), gui_(0)
+ bookmark_edit_position_(-1), gui_(0)
{}
///
<< ", singlepar = " << (flags & Update::SinglePar)
<< "] buffer: " << &buffer_);
+ // FIXME Does this really need doing here? It's done in updateBuffer, and
+ // if the Buffer doesn't need updating, then do the macros?
buffer_.updateMacros();
// Now do the first drawing step if needed. This consists on updating
}
-void BufferView::scrollDocView(int value)
+void BufferView::scrollDocView(int value, bool update)
{
int const offset = value - d->scrollbarParameters_.position;
// cut off at the top
if (value <= d->scrollbarParameters_.min) {
DocIterator dit = doc_iterator_begin(&buffer_);
- showCursor(dit);
+ showCursor(dit, false, update);
LYXERR(Debug::SCROLLING, "scroll to top");
return;
}
if (value >= d->scrollbarParameters_.max) {
DocIterator dit = doc_iterator_end(&buffer_);
dit.backwardPos();
- showCursor(dit);
+ showCursor(dit, false, update);
LYXERR(Debug::SCROLLING, "scroll to bottom");
return;
}
// It seems we didn't find the correct pit so stay on the safe side and
// scroll to bottom.
LYXERR0("scrolling position not found!");
- scrollDocView(d->scrollbarParameters_.max);
+ scrollDocView(d->scrollbarParameters_.max, update);
return;
}
DocIterator dit = doc_iterator_begin(&buffer_);
dit.pit() = i;
LYXERR(Debug::SCROLLING, "value = " << value << " -> scroll to pit " << i);
- showCursor(dit);
+ showCursor(dit, false, update);
}
void BufferView::recenter()
{
- showCursor(d->cursor_, true);
+ showCursor(d->cursor_, true, true);
}
void BufferView::showCursor()
{
- showCursor(d->cursor_, false);
+ showCursor(d->cursor_, false, true);
}
-void BufferView::showCursor(DocIterator const & dit, bool recenter)
+void BufferView::showCursor(DocIterator const & dit,
+ bool recenter, bool update)
{
- if (scrollToCursor(dit, recenter)) {
+ if (scrollToCursor(dit, recenter) && update) {
buffer_.changed(true);
updateHoveredInset();
}
setCursor(backcur.asDocIterator(&buffer_));
buffer_.errors("Class Switch");
- buffer_.updateBuffer();
}
/** Return the change status at cursor position, taking in account the
// It is then better to make sure that all dialogs are in sync with
// current document settings.
dr.update(Update::Force | Update::FitCursor);
+ dr.forceBufferUpdate();
break;
}
buffer_.params().makeDocumentClass();
updateDocumentClass(oldClass);
dr.update(Update::Force | Update::FitCursor);
+ dr.forceBufferUpdate();
break;
}
buffer_.params().makeDocumentClass();
updateDocumentClass(oldClass);
dr.update(Update::Force | Update::FitCursor);
+ dr.forceBufferUpdate();
break;
}
buffer_.params().makeDocumentClass();
updateDocumentClass(oldDocClass);
dr.update(Update::Force | Update::FitCursor);
+ dr.forceBufferUpdate();
break;
}
buffer_.params().makeDocumentClass();
updateDocumentClass(oldClass);
dr.update(Update::Force | Update::FitCursor);
+ dr.forceBufferUpdate();
break;
}
dr.setMessage(_("No further undo information"));
else
dr.update(Update::Force | Update::FitCursor);
+ dr.forceBufferUpdate();
break;
case LFUN_REDO:
dr.setMessage(_("No further redo information"));
else
dr.update(Update::Force | Update::FitCursor);
+ dr.forceBufferUpdate();
break;
case LFUN_FONT_STATE:
case LFUN_CHANGES_MERGE:
if (findNextChange(this) || findPreviousChange(this)) {
dr.update(Update::Force | Update::FitCursor);
+ dr.forceBufferUpdate();
showDialog("changes");
}
break;
buffer_.text().acceptOrRejectChanges(cur, Text::ACCEPT);
// FIXME: Move this LFUN to Buffer so that we don't have to do this:
dr.update(Update::Force | Update::FitCursor);
+ dr.forceBufferUpdate();
break;
case LFUN_ALL_CHANGES_REJECT:
buffer_.text().acceptOrRejectChanges(cur, Text::REJECT);
// FIXME: Move this LFUN to Buffer so that we don't have to do this:
dr.update(Update::Force | Update::FitCursor);
+ dr.forceBufferUpdate();
break;
case LFUN_WORD_FIND_FORWARD:
}
}
replace(this, cmd, has_deleted);
+ dr.forceBufferUpdate();
break;
}
//FIXME: what to do with cur.x_target()?
bool update = in_texted && cur.bv().checkDepm(cur, old);
cur.finishUndo();
- if (update)
+ if (update) {
dr.update(Update::Force | Update::FitCursor);
+ dr.forceBufferUpdate();
+ }
break;
}
case LFUN_SCROLL:
lfunScroll(cmd);
+ dr.forceBufferUpdate();
break;
case LFUN_SCREEN_UP_SELECT: {
cur = savecur;
cur.fixIfBroken();
dr.update(Update::Force);
+ dr.forceBufferUpdate();
if (iterations >= max_iter) {
dr.setError(true);
Alert::warning(_("Branch already exists"), drtmp.message());
break;
}
- lyx::dispatch(FuncRequest(LFUN_BRANCH_INSERT, branch_name));
+ BranchList & branch_list = buffer_.params().branchlist();
+ vector<docstring> const branches =
+ getVectorFromString(branch_name, branch_list.separator());
+ for (vector<docstring>::const_iterator it = branches.begin();
+ it != branches.end(); ++it) {
+ branch_name = *it;
+ lyx::dispatch(FuncRequest(LFUN_BRANCH_INSERT, branch_name));
+ }
break;
}
FuncRequest fr(LFUN_INSET_MODIFY, cmd.argument());
inset->dispatch(cur, fr);
dr.update(Update::SinglePar | Update::FitCursor);
+ dr.forceBufferUpdate();
break;
}
d->cursor_ = cur;
- buffer_.updateBuffer();
+ cur.forceBufferUpdate();
buffer_.changed(true);
return true;
}
d->cursor_.finishUndo();
d->cursor_.setCurrentFont();
+ if (update)
+ cur.forceBufferUpdate();
return update;
}
// set update flags
if (changed) {
if (singlePar && !(cur.result().update() & Update::Force))
- cur.updateFlags(cur.result().update() | Update::SinglePar);
+ cur.screenUpdateFlags(cur.result().update() | Update::SinglePar);
else
- cur.updateFlags(cur.result().update() | Update::Force);
+ cur.screenUpdateFlags(cur.result().update() | Update::Force);
}
}