summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a007c0e)
raw | patch | inline | side by side (parent: a007c0e)
author | Jeffrey Middleton <jefromi@gmail.com> | |
Wed, 15 Apr 2009 19:07:41 +0000 (14:07 -0500) | ||
committer | Max Kellermann <max@duempel.org> | |
Fri, 17 Apr 2009 07:49:16 +0000 (09:49 +0200) |
When moving the cursor to make sure it is visible after recentering,
move it to the offset position from the edge of the screen.
(Previously, it was placed at the edge, causing the offset to force the
screen to scroll.)
move it to the offset position from the edge of the screen.
(Previously, it was placed at the edge, causing the offset to force the
screen to scroll.)
src/screen_play.c | patch | blob | history |
diff --git a/src/screen_play.c b/src/screen_play.c
index 7327364b010c22c12d4efc537c9144a0aecb76bf..28d39134625f8a32dbcec75a2926f1223a23e555 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
}
/* make sure the cursor is in the window */
- if (lw->selected < lw->start) {
- lw->selected = lw->start;
+ if (lw->selected < lw->start + options.scroll_offset) {
+ if (lw->start > 0)
+ lw->selected = lw->start + options.scroll_offset;
if (lw->range_selection) {
lw->selected_start = lw->range_base;
lw->selected_end = lw->selected;
lw->selected_start = lw->selected;
lw->selected_end = lw->selected;
}
- } else if (lw->selected > lw->start + lw->rows - 1) {
- lw->selected = lw->start + lw->rows - 1;
+ } else if (lw->selected > lw->start + lw->rows - 1 - options.scroll_offset) {
+ if (lw->start + lw->rows < length)
+ lw->selected = lw->start + lw->rows - 1 - options.scroll_offset;
if (lw->range_selection) {
lw->selected_start = lw->selected;
lw->selected_end = lw->range_base;