version 1.10, 2002/01/10 12:13:35 |
version 1.11, 2002/01/18 08:37:08 |
|
|
tcinsl = charcost(insert_line); |
tcinsl = charcost(insert_line); |
else |
else |
/* make this cost high enough */ |
/* make this cost high enough */ |
tcinsl = NROW * NCOL; |
tcinsl = nrow * ncol; |
|
|
/* Estimate cost of deleting a line */ |
/* Estimate cost of deleting a line */ |
if (change_scroll_region) |
if (change_scroll_region) |
|
|
tcdell = charcost(delete_line); |
tcdell = charcost(delete_line); |
else |
else |
/* make this cost high enough */ |
/* make this cost high enough */ |
tcdell = NROW * NCOL; |
tcdell = nrow * ncol; |
|
|
/* Flag to indicate that we can both insert and delete lines */ |
/* Flag to indicate that we can both insert and delete lines */ |
insdel = (insert_line || parm_insert_line) && |
insdel = (insert_line || parm_insert_line) && |
|
|
|
|
/* |
/* |
* This routine is called by the "refresh the screen" command to try |
* This routine is called by the "refresh the screen" command to try |
* to resize the display. The new size, which must not exceed the NROW |
* to resize the display. Look in "window.c" to see how |
* and NCOL limits, is stored back into "nrow" and * "ncol". Display can |
|
* always deal with a screen NROW by NCOL. Look in "window.c" to see how |
|
* the caller deals with a change. |
* the caller deals with a change. |
|
* |
|
* We use `newrow' and `newcol' so vtresize() know the difference between the |
|
* new and old settings. |
*/ |
*/ |
void |
void |
ttresize() |
ttresize() |
{ |
{ |
|
int newrow = 0, newcol = 0; |
|
|
#ifdef TIOCGWINSZ |
#ifdef TIOCGWINSZ |
struct winsize winsize; |
struct winsize winsize; |
|
|
if (ioctl(0, TIOCGWINSZ, (char *) &winsize) == 0) { |
if (ioctl(0, TIOCGWINSZ, (char *) &winsize) == 0) { |
nrow = winsize.ws_row; |
newrow = winsize.ws_row; |
ncol = winsize.ws_col; |
newcol = winsize.ws_col; |
} else nrow = 0; |
} |
#endif |
#endif |
if ((nrow <= 0 || ncol <= 0) && |
if ((newrow <= 0 || newcol <= 0) && |
((nrow = lines) <= 0 || (ncol = columns) <= 0)) { |
((newrow = lines) <= 0 || (newcol = columns) <= 0)) { |
nrow = 24; |
newrow = 24; |
ncol = 80; |
newcol = 80; |
} |
} |
|
if (vtresize(1, newrow, newcol)) |
/* Enforce maximum screen size. */ |
panic("vtresize failed"); |
if (nrow > NROW) |
nrow = newrow; |
nrow = NROW; |
ncol = newcol; |
if (ncol > NCOL) |
|
ncol = NCOL; |
|
} |
} |
|
|
/* |
/* |