buffer_ = b;
top_y_ = 0;
-
+
// if we're quitting lyx, don't bother updating stuff
if (quitting)
return;
text->selection.end != bv_->text->xsel_cache.end))
{
bv_->text->xsel_cache = text->selection;
- sel = text->selectionAsString(bv_->buffer(), false);
+ sel = text->selectionAsString(*bv_->buffer(), false);
} else if (!text->selection.set()) {
sel = string();
bv_->text->xsel_cache.set(false);
if (bv_->getLyXText()) {
// check needed to survive LyX startup
bv_->getLyXText()->redoCursor();
- fitCursor();
}
screen().redraw(*bv_);
}
beforeChange(text);
int const half_height = workarea().workHeight() / 2;
- int new_y = 0;
-
- if (text->cursor.y() > half_height)
- new_y = text->cursor.y() - half_height;
+ int new_y = std::max(0, text->cursor.y() - half_height);
// FIXME: look at this comment again ...
screen().hideCursor();
bool const res = dispatch(ev);
-
+
// see workAreaKeyPress
cursor_timeout.restart();
screen().showCursor(*bv_);
string arg = ev.argument;
if (arg.empty()) {
- arg = bv_->getLyXText()->selectionAsString(buffer_,
+ arg = bv_->getLyXText()->selectionAsString(*buffer_,
false);
// FIXME
if (arg.size() > 100 || arg.empty()) {
// Get word or selection
bv_->getLyXText()->selectWordWhenUnderCursor(lyx::WHOLE_WORD);
- arg = bv_->getLyXText()->selectionAsString(buffer_, false);
+ arg = bv_->getLyXText()->selectionAsString(*buffer_, false);
// FIXME: where is getLyXText()->unselect(bv_) ?
}
}