aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2010-09-29 16:12:09 +1000
committernyamatongwe <unknown>2010-09-29 16:12:09 +1000
commit15cba034be296796459bc7c00f9c330ea483b77a (patch)
tree52b011ba48ba27f0325a10c100082dc8705224b2
parentf6e48024aa42a927c61206933320f39aebc3c234 (diff)
downloadscintilla-mirror-15cba034be296796459bc7c00f9c330ea483b77a.tar.gz
Fix for bug #3077452 PgUp/PgDn not virtual space aware.
-rw-r--r--src/Editor.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 836f3919a..84907b01d 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -4605,9 +4605,9 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lPar
* If stuttered = true and already at first/last row, scroll as normal.
*/
void Editor::PageMove(int direction, Selection::selTypes selt, bool stuttered) {
- int topLineNew, newPos;
+ int topLineNew;
+ SelectionPosition newPos;
- // I consider only the caretYSlop, and ignore the caretYPolicy-- is that a problem?
int currentLine = pdoc->LineFromPosition(sel.MainCaret());
int topStutterLine = topLine + caretYSlop;
int bottomStutterLine =
@@ -4617,28 +4617,31 @@ void Editor::PageMove(int direction, Selection::selTypes selt, bool stuttered) {
if (stuttered && (direction < 0 && currentLine > topStutterLine)) {
topLineNew = topLine;
- newPos = PositionFromLocation(Point(lastXChosen - xOffset, vs.lineHeight * caretYSlop));
+ newPos = SPositionFromLocation(Point(lastXChosen - xOffset, vs.lineHeight * caretYSlop),
+ false, false, UserVirtualSpace());
} else if (stuttered && (direction > 0 && currentLine < bottomStutterLine)) {
topLineNew = topLine;
- newPos = PositionFromLocation(Point(lastXChosen - xOffset, vs.lineHeight * (LinesToScroll() - caretYSlop)));
+ newPos = SPositionFromLocation(Point(lastXChosen - xOffset, vs.lineHeight * (LinesToScroll() - caretYSlop)),
+ false, false, UserVirtualSpace());
} else {
Point pt = LocationFromPosition(sel.MainCaret());
topLineNew = Platform::Clamp(
topLine + direction * LinesToScroll(), 0, MaxScrollPos());
- newPos = PositionFromLocation(
- Point(lastXChosen - xOffset, pt.y + direction * (vs.lineHeight * LinesToScroll())));
+ newPos = SPositionFromLocation(
+ Point(lastXChosen - xOffset, pt.y + direction * (vs.lineHeight * LinesToScroll())),
+ false, false, UserVirtualSpace());
}
if (topLineNew != topLine) {
SetTopLine(topLineNew);
- MovePositionTo(SelectionPosition(newPos), selt);
+ MovePositionTo(newPos, selt);
Redraw();
SetVerticalScrollPos();
} else {
- MovePositionTo(SelectionPosition(newPos), selt);
+ MovePositionTo(newPos, selt);
}
}