* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
* This code is derived from software contributed to Berkeley by
* Edward Wang at The University of California, Berkeley.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)cmd7.c 8.1 (Berkeley) %G%";
wwputs("New window size (lower right corner): ", cmdwin
);
col
= MIN(w
->ww_w
.r
, wwncol
) - 1;
row
= MIN(w
->ww_w
.b
, wwnrow
) - 1;
wwadd(boxwin
, framewin
->ww_back
);
wwbox(boxwin
, w
->ww_w
.t
- 1, w
->ww_w
.l
- 1,
row
- w
->ww_w
.t
+ 3, col
- w
->ww_w
.l
+ 3);
switch (getpos(&row
, &col
, w
->ww_w
.t
, w
->ww_w
.l
,
wwnrow
- 1, wwncol
- 1)) {
sizewin(w
, row
- w
->ww_w
.t
+ 1, col
- w
->ww_w
.l
+ 1);
struct yb
*yb_head
, *yb_tail
;
wwputs("Yank starting position: ", cmdwin
);
switch (getpos(&row1
, &col1
, w
->ww_i
.t
, w
->ww_i
.l
,
w
->ww_i
.b
- 1, w
->ww_i
.r
- 1)) {
wwputs("\nYank ending position: ", cmdwin
);
switch (getpos(&row2
, &col2
, w
->ww_i
.t
, w
->ww_i
.l
,
w
->ww_i
.b
- 1, w
->ww_i
.r
- 1)) {
yank_highlight(row1
, col1
, r
, c
);
yank_highlight(row1
, col1
, r
, c
);
yank_highlight(row1
, col1
, row2
, col2
);
if (row2
< row1
|| row2
== row1
&& col2
< col1
) {
for (r
= row1
; r
< row2
; r
++) {
yank_line(r
, c
, w
->ww_b
.r
);
yank_highlight(row1
, col1
, row2
, col2
);
yank_highlight(row1
, col1
, row2
, col2
)
if ((wwavailmodes
& WWM_REV
) == 0)
if (row2
< row1
|| row2
== row1
&& col2
< col1
) {
for (r
= row1
; r
< row2
; r
++) {
yank_highlight_line(r
, c
, w
->ww_b
.r
);
yank_highlight_line(r
, c
, col2
);
yank_highlight_line(r
, c
, cend
)
if (r
< w
->ww_i
.t
|| r
>= w
->ww_i
.b
)
for (win
= w
->ww_win
[r
] + c
; c
< cend
; c
++, win
++) {
if (wwsmap
[r
][c
] == w
->ww_index
) {
else if (*win
== WWM_REV
)
wwns
[r
][c
].c_m
^= WWM_REV
;
wwtouched
[r
] |= WWU_TOUCHED
;
for (yp
= yb_head
; yp
; yp
= yq
) {
if ((yp
= (struct yb
*) malloc(sizeof *yp
)) == 0)
nl
= cend
== selwin
->ww_b
.r
;
for (cend
--; cend
>= c
; cend
--)
yp
->length
= n
= cend
- c
+ 1;
yp
->line
= str_alloc(yp
->length
+ 1);
for (bp
+= c
, cp
= yp
->line
; --n
>= 0;)
yb_tail
= yb_tail
->link
= yp
;
for (yp
= yb_head
; yp
; yp
= yp
->link
)
(void) write(selwin
->ww_pty
, yp
->line
, yp
->length
);