mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-03 14:13:58 +00:00
Fix PageUp/Down select when at the top/bottom of a document.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23510 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3ba3389ede
commit
5a9653203f
@ -312,6 +312,18 @@ int BufferView::leftMargin() const
|
||||
}
|
||||
|
||||
|
||||
bool BufferView::isTopScreen() const
|
||||
{
|
||||
return d->scrollbarParameters_.position == d->scrollbarParameters_.min;
|
||||
}
|
||||
|
||||
|
||||
bool BufferView::isBottomScreen() const
|
||||
{
|
||||
return d->scrollbarParameters_.position == d->scrollbarParameters_.max;
|
||||
}
|
||||
|
||||
|
||||
Intl & BufferView::getIntl()
|
||||
{
|
||||
return d->intl_;
|
||||
|
@ -96,6 +96,12 @@ public:
|
||||
/// left margin
|
||||
int leftMargin() const;
|
||||
|
||||
/// \return true if the BufferView is at the top of the document.
|
||||
bool isTopScreen() const;
|
||||
|
||||
/// \return true if the BufferView is at the bottom of the document.
|
||||
bool isBottomScreen() const;
|
||||
|
||||
/// perform pending metrics updates.
|
||||
/** \c Update::FitCursor means first to do a FitCursor, and to
|
||||
* force an update if screen position changes.
|
||||
|
@ -1613,6 +1613,14 @@ int TextMetrics::cursorY(CursorSlice const & sl, bool boundary) const
|
||||
|
||||
void TextMetrics::cursorPrevious(Cursor & cur)
|
||||
{
|
||||
if (bv_->isTopScreen()) {
|
||||
lyx::dispatch(FuncRequest(cur.selection()
|
||||
? LFUN_BUFFER_BEGIN_SELECT : LFUN_BUFFER_BEGIN));
|
||||
cur.finishUndo();
|
||||
cur.updateFlags(Update::None);
|
||||
return;
|
||||
}
|
||||
|
||||
pos_type cpos = cur.pos();
|
||||
pit_type cpar = cur.pit();
|
||||
|
||||
@ -1638,6 +1646,14 @@ void TextMetrics::cursorPrevious(Cursor & cur)
|
||||
|
||||
void TextMetrics::cursorNext(Cursor & cur)
|
||||
{
|
||||
if (bv_->isBottomScreen()) {
|
||||
lyx::dispatch(FuncRequest(cur.selection()
|
||||
? LFUN_BUFFER_END_SELECT : LFUN_BUFFER_END));
|
||||
cur.finishUndo();
|
||||
cur.updateFlags(Update::None);
|
||||
return;
|
||||
}
|
||||
|
||||
pos_type cpos = cur.pos();
|
||||
pit_type cpar = cur.pit();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user