diff options
| author | Gerd Moellmann | 2001-08-07 14:19:26 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-08-07 14:19:26 +0000 |
| commit | d466fa4dcf7844926c7c19a628680d7c10d3b6be (patch) | |
| tree | 086ca6928f01243f09fb7bd590675ba381ef92fe /src | |
| parent | e8421604cdd386af0c32fb7cf698882ec6b74015 (diff) | |
| download | emacs-d466fa4dcf7844926c7c19a628680d7c10d3b6be.tar.gz emacs-d466fa4dcf7844926c7c19a628680d7c10d3b6be.zip | |
(Frecenter): If ARG < 0, and on a window system
frame, count in some empty lines when we can't move -ARG lines
down.
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/window.c b/src/window.c index 5abff76c434..abd2e6230ab 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -4586,18 +4586,26 @@ and redisplay normally--don't erase and redraw the frame.") | |||
| 4586 | { | 4586 | { |
| 4587 | struct it it; | 4587 | struct it it; |
| 4588 | struct text_pos pt; | 4588 | struct text_pos pt; |
| 4589 | int y0, y1, h; | 4589 | int y0, y1, h, nlines; |
| 4590 | 4590 | ||
| 4591 | SET_TEXT_POS (pt, PT, PT_BYTE); | 4591 | SET_TEXT_POS (pt, PT, PT_BYTE); |
| 4592 | start_display (&it, w, pt); | 4592 | start_display (&it, w, pt); |
| 4593 | y0 = it.current_y; | 4593 | y0 = it.current_y; |
| 4594 | 4594 | ||
| 4595 | /* The amount of pixels we have to move hack is the window | 4595 | /* The amount of pixels we have to move back is the window |
| 4596 | height minus what's displayed in the line containing PT, | 4596 | height minus what's displayed in the line containing PT, |
| 4597 | and the lines below. */ | 4597 | and the lines below. */ |
| 4598 | move_it_by_lines (&it, - XINT (arg) - 1, 1); | 4598 | nlines = - XINT (arg) - 1; |
| 4599 | move_it_by_lines (&it, nlines, 1); | ||
| 4600 | |||
| 4599 | y1 = it.current_y - y0; | 4601 | y1 = it.current_y - y0; |
| 4600 | h = line_bottom_y (&it) - y1; | 4602 | h = line_bottom_y (&it) - y1; |
| 4603 | |||
| 4604 | /* If we can't move down NLINES lines because we hit | ||
| 4605 | the end of the buffer, count in some empty lines. */ | ||
| 4606 | if (it.vpos < nlines) | ||
| 4607 | y1 += (nlines - it.vpos) * CANON_Y_UNIT (it.f); | ||
| 4608 | |||
| 4601 | y0 = it.last_visible_y - y1 - h; | 4609 | y0 = it.last_visible_y - y1 - h; |
| 4602 | 4610 | ||
| 4603 | start_display (&it, w, pt); | 4611 | start_display (&it, w, pt); |