// causes screen update(), I reset last_inset_ to avoid such a problem.
last_inset_ = 0;
// This is close to a hot-path.
- if (lyxerr.debugging(Debug::DEBUG)) {
- LYXERR(Debug::DEBUG)
- << BOOST_CURRENT_FUNCTION
- << "[fitcursor = " << (flags & Update::FitCursor)
- << ", forceupdate = " << (flags & Update::Force)
- << ", singlepar = " << (flags & Update::SinglePar)
- << "] buffer: " << buffer_ << endl;
- }
+ LYXERR(Debug::DEBUG)
+ << BOOST_CURRENT_FUNCTION
+ << "[fitcursor = " << (flags & Update::FitCursor)
+ << ", forceupdate = " << (flags & Update::Force)
+ << ", singlepar = " << (flags & Update::SinglePar)
+ << "] buffer: " << buffer_ << endl;
// Check needed to survive LyX startup
if (!buffer_)
return false;
- if (lyxerr.debugging(Debug::WORKAREA)) {
- LYXERR(Debug::WORKAREA) << "BufferView::update" << std::endl;
- }
+ LYXERR(Debug::WORKAREA) << "BufferView::update" << std::endl;
// Update macro store
buffer_->buildMacros();
offset_ref_ = 0;
}
- if (lyxerr.debugging(Debug::GUI)) {
- LYXERR(Debug::GUI)
- << BOOST_CURRENT_FUNCTION
- << " Updating scrollbar: height: " << t.paragraphs().size()
- << " curr par: " << cursor_.bottom().pit()
- << " default height " << defaultRowHeight() << endl;
- }
+ LYXERR(Debug::GUI)
+ << BOOST_CURRENT_FUNCTION
+ << " Updating scrollbar: height: " << t.paragraphs().size()
+ << " curr par: " << cursor_.bottom().pit()
+ << " default height " << defaultRowHeight() << endl;
// It would be better to fix the scrollbar to understand
// values in [0..1] and divide everything by wh
// Has the cursor just left the inset?
bool badcursor = false;
- if (&cursor_.inset() != &cur.inset())
+ bool leftinset = (&cursor_.inset() != &cur.inset());
+ if (leftinset)
badcursor = cursor_.inset().notifyCursorLeaves(cursor_);
// do the dEPM magic if needed
- // FIXME: move this to InsetText::notifyCursorLeaves?
- bool update = false;
+ // FIXME: (1) move this to InsetText::notifyCursorLeaves?
+ // FIXME: (2) if we had a working InsetText::notifyCursorLeaves,
+ // the leftinset bool would not be necessary (badcursor instead).
+ bool update = leftinset;
if (!badcursor && cursor_.inTexted())
- checkDepm(cur, cursor_);
+ update |= checkDepm(cur, cursor_);
// if the cursor was in an empty script inset and the new
// position is in the nucleus of the inset, notifyCursorLeaves
FileDialog fileDlg(_("Select LyX document to insert"),
LFUN_FILE_INSERT,
make_pair(_("Documents|#o#O"), from_utf8(lyxrc.document_path)),
- make_pair(_("Examples|#E#e"), from_utf8(addPath(package().system_support(), "examples"))));
+ make_pair(_("Examples|#E#e"), from_utf8(addPath(package().system_support().absFilename(), "examples"))));
FileDialog::Result result =
fileDlg.open(from_utf8(initpath),