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)
{}
///
fp.pit = d->cursor_.bottom().pit();
fp.pos = d->cursor_.bottom().pos();
theSession().lastFilePos().save(buffer_.fileName(), fp);
+
+ if (d->last_inset_)
+ d->last_inset_->setMouseHover(this, false);
delete d;
}
}
-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();
}
flag.setOnOff(buffer_.params().compressed);
break;
}
-
+
+ case LFUN_BUFFER_TOGGLE_OUTPUT_SYNC: {
+ flag.setOnOff(buffer_.params().output_sync);
+ break;
+ }
+
case LFUN_SCREEN_UP:
case LFUN_SCREEN_DOWN:
case LFUN_SCROLL:
buffer_.params().compressed = !buffer_.params().compressed;
break;
+ case LFUN_BUFFER_TOGGLE_OUTPUT_SYNC:
+ buffer_.params().output_sync = !buffer_.params().output_sync;
+ break;
+
case LFUN_SCREEN_UP:
case LFUN_SCREEN_DOWN: {
Point p = getPos(cur);
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;
}
return;
bool need_redraw = false;
- if (d->last_inset_)
+ if (d->last_inset_) {
// Remove the hint on the last hovered inset (if any).
need_redraw |= d->last_inset_->setMouseHover(this, false);
+ d->last_inset_ = 0;
+ }
// const_cast because of setMouseHover().
Inset * inset = const_cast<Inset *>(covering_inset);
- if (inset)
- // Highlight the newly hovered inset (if any).
- need_redraw |= inset->setMouseHover(this, true);
+ if (inset && inset->setMouseHover(this, true)) {
+ need_redraw = true;
+ // Only the insets that accept the hover state, do
+ // clear the last_inset_, so only set the last_inset_
+ // member if the hovered setting is accepted.
+ d->last_inset_ = inset;
+ }
- d->last_inset_ = inset;
-
if (need_redraw) {
LYXERR(Debug::PAINTING, "Mouse hover detected at: ("
<< d->mouse_position_cache_.x_ << ", "