Commit | Line | Data |
---|---|---|
2c7129ee | 1 | #ifndef lint |
60de5df9 | 2 | static char sccsid[] = "@(#)wwinsline.c 3.7 %G%"; |
2c7129ee EW |
3 | #endif |
4 | ||
60de5df9 EW |
5 | /* |
6 | * Copyright (c) 1983 Regents of the University of California, | |
7 | * All rights reserved. Redistribution permitted subject to | |
8 | * the terms of the Berkeley Software License Agreement. | |
9 | */ | |
10 | ||
2c7129ee EW |
11 | #include "ww.h" |
12 | ||
f2a77fe1 | 13 | wwinsline(w, row) |
2c7129ee | 14 | register struct ww *w; |
f2a77fe1 | 15 | int row; |
2c7129ee EW |
16 | { |
17 | register i; | |
14f251df | 18 | register union ww_char **cpp, **cqq; |
74f2441e | 19 | register union ww_char *cp; |
f2a77fe1 | 20 | int row1, row2; |
14f251df | 21 | char deleted; |
74f2441e | 22 | int visible; |
2c7129ee EW |
23 | |
24 | /* | |
14f251df | 25 | * Scroll first. |
2c7129ee | 26 | */ |
f2a77fe1 EW |
27 | if ((row1 = row) < w->ww_i.t) { |
28 | row1 = w->ww_i.t; | |
74f2441e EW |
29 | visible = 0; |
30 | } else | |
31 | visible = 1; | |
f2a77fe1 EW |
32 | if ((row2 = w->ww_b.b) > w->ww_i.b) { |
33 | row2 = w->ww_i.b; | |
34 | } | |
35 | deleted = wwscroll1(w, row1, row2, -1, visible); | |
14f251df | 36 | |
2c7129ee | 37 | /* |
14f251df EW |
38 | * Fix the buffer. |
39 | * But leave clearing the last line for wwclreol(). | |
2c7129ee | 40 | */ |
f2a77fe1 | 41 | cpp = &w->ww_buf[w->ww_b.b]; |
14f251df | 42 | cqq = cpp - 1; |
74f2441e | 43 | cp = *cqq; |
f2a77fe1 | 44 | for (i = w->ww_b.b - row; --i > 0;) |
14f251df | 45 | *--cpp = *--cqq; |
74f2441e | 46 | *cqq = cp; |
2c7129ee | 47 | |
2c7129ee | 48 | /* |
14f251df | 49 | * Now clear the last line. |
2c7129ee | 50 | */ |
74f2441e | 51 | if (visible) |
f2a77fe1 | 52 | wwclreol1(w, row, w->ww_b.l, deleted); |
74f2441e | 53 | else |
f2a77fe1 | 54 | for (i = w->ww_b.nc; --i >= 0;) |
74f2441e | 55 | cp++->c_w = ' '; |
2c7129ee | 56 | } |