Lines Matching +full:num +full:- +full:cols

2  * ed.screen.c: Editor/termcap-curses interface
4 /*-
341 * A very useful table from justin@crim.ca (Justin Bur) :-)
343 * - first (and second:-) case fixed)
347 * -------------- ------- ------- ------------ ------------
350 * No Wrap no -- yes yes
363 xfree(t->str); in TCset()
364 t->str = NULL; in TCset()
369 t->str = xrealloc(t->str, size); in TCset()
370 memcpy(t->str, cap, size); in TCset()
403 for (t = tstr; t->name != NULL; t++) { in TellTC()
404 s = strsave(t->str && *t->str ? t->str : CGETS(7, 13, "(empty)")); in TellTC()
406 xprintf("\t%36s (%s) == %s\n", t->long_name, t->name, s); in TellTC()
450 for (ts = tstr; ts->name != NULL; ts++) in SetTC()
451 if (strcmp(ts->name, what) == 0) in SetTC()
453 if (ts->name != NULL) { in SetTC()
475 for (tv = tval; tv->name != NULL; tv++) in SetTC()
476 if (strcmp(tv->name, what) == 0) in SetTC()
479 if (tv->name != NULL) { in SetTC()
483 tv->val = 1; in SetTC()
485 tv->val = 0; in SetTC()
487 stderror(ERR_SETTCUS, tv->name); in SetTC()
499 tv->val = atoi(how); in SetTC()
537 if (v[0][0] == '-') { in EchoTC()
591 else if (strcmp(cv, "cols") == 0 || strcmp(cv, "co") == 0) { in EchoTC()
600 for (t = tstr; t->name != NULL; t++) in EchoTC()
601 if (strcmp(t->name, cv) == 0) { in EchoTC()
602 scap = t->str; in EchoTC()
605 if (t->name == NULL) in EchoTC()
831 if (Strcmp(name->buf, arrow[i].name) == 0) { in SetArrowKeys()
836 return -1; in SetArrowKeys()
854 if (Strcmp(name->buf, arrow[i].name) == 0) { in ClearArrowKeys()
858 return -1; in ClearArrowKeys()
867 if (name->len == 0 || Strcmp(name->buf, arrow[i].name) == 0) in PrintArrowKeys()
897 * 1. They are multi-character arrow keys and the user in BindArrowKeys()
898 * has not re-assigned the leading character, or in BindArrowKeys()
899 * has re-assigned the leading character to be F_XKEY in BindArrowKeys()
1006 /* PWP 6-27-88 -- if the tty driver thinks that we can tab, we ask termcap */
1030 del = where - CursorV; in MoveToLine()
1037 for (h = TermH - 1; h > 0 && Display[CursorV][h] == CHAR_DBWIDTH; in MoveToLine()
1038 h--) in MoveToLine()
1042 so_write(&Display[CursorV][CursorH], TermH - CursorH); /* updates CursorH/V*/ in MoveToLine()
1043 del--; in MoveToLine()
1051 for ( ; del > 0; del--) in MoveToLine()
1059 if (GoodStr(T_UP) && (-del > 1 || !GoodStr(T_up))) in MoveToLine()
1060 (void) tputs(tgoto(Str(T_UP), -del, -del), -del, PUTPURE); in MoveToLine()
1064 for (i = 0; i < -del; i++) in MoveToLine()
1094 del = where - CursorH; in MoveToChar()
1096 if ((del < -4 || del > 4) && GoodStr(T_ch)) in MoveToChar()
1114 TermH - 1 for the wrapping, it would be nice to in MoveToChar()
1116 - but this doesn't work for all terminals! */ in MoveToChar()
1122 so_write(&Display[CursorV][CursorH], where - CursorH); in MoveToChar()
1127 if ((-del > 4) && GoodStr(T_LE)) in MoveToChar()
1128 (void) tputs(tgoto(Str(T_LE), -del, -del), -del, PUTPURE); in MoveToChar()
1131 if (T_Tabs ? (-del > ((where >> 3) + (where & 07))) in MoveToChar()
1132 : (-del > where)) { in MoveToChar()
1137 for (i = 0; i < -del; i++) in MoveToChar()
1165 prompt_len = promptc - Prompt; in so_write()
1169 region_start = (Cursor - InputBuf) + prompt_len; in so_write()
1172 region_start = (min(Cursor, Mark) - InputBuf) + prompt_len; in so_write()
1173 region_end = (max(Cursor, Mark) - InputBuf) + prompt_len; in so_write()
1188 if (highlighting && cur_pos == (Cursor - InputBuf) + prompt_len) in so_write()
1206 } while (--n); in so_write()
1230 CursorH = TermH - 1; in so_write()
1236 DeleteChars(int num) /* deletes <num> characters */ in DeleteChars() argument
1238 if (num <= 0) in DeleteChars()
1249 if (num > TermH) { in DeleteChars()
1251 xprintf(CGETS(7, 17, "DeleteChars: num is riduculous: %d\r\n"), num); in DeleteChars()
1258 if ((num > 1) || !GoodStr(T_dc)) { /* if dc would be more expen. */ in DeleteChars()
1259 (void) tputs(tgoto(Str(T_DC), num, num), num, PUTPURE); in DeleteChars()
1267 while (num--) in DeleteChars()
1274 /* Puts terminal in insert character mode, or inserts num characters in the
1277 Insert_write(Char *cp, int num) in Insert_write() argument
1279 if (num <= 0) in Insert_write()
1289 if (num > TermH) { in Insert_write()
1291 xprintf(CGETS(7, 19, "StartInsert: num is riduculous: %d\r\n"), num); in Insert_write()
1298 if ((num > 1) || !GoodStr(T_ic)) { /* if ic would be more expen. */ in Insert_write()
1299 (void) tputs(tgoto(Str(T_IC), num, num), num, PUTPURE); in Insert_write()
1300 so_write(cp, num); /* this updates CursorH/V */ in Insert_write()
1307 so_write(cp, num); /* this updates CursorH/V */ in Insert_write()
1309 if (GoodStr(T_ip)) /* have to make num chars insert */ in Insert_write()
1317 if (GoodStr(T_ic)) /* have to make num chars insert */ in Insert_write()
1322 if (GoodStr(T_ip)) /* have to make num chars insert */ in Insert_write()
1325 } while (--num); in Insert_write()
1329 /* clear to end of line. There are num characters to clear */
1331 ClearEOL(int num) in ClearEOL() argument
1335 if (num <= 0) in ClearEOL()
1341 for (i = 0; i < num; i++) in ClearEOL()
1343 CursorH += num; /* have written num spaces */ in ClearEOL()
1402 int lins, cols; in GetTermCaps() local
1434 if (i == -1) { in GetTermCaps()
1448 for (t = tstr; t->name != NULL; t++) in GetTermCaps()
1460 for (t = tstr; t->name != NULL; t++) in GetTermCaps()
1461 TCset(t, tgetstr(t->name, &area)); in GetTermCaps()
1504 (void) GetSize(&lins, &cols); /* get the correct window size */ in GetTermCaps()
1505 ChangeSize(lins, cols); in GetTermCaps()
1517 * Return the new window size in lines and cols, and
1522 GetSize(int *lins, int *cols) in GetSize() argument
1524 *cols = Val(T_co); in GetSize()
1533 if (ioctl(SHIN, TIOCGWINSZ, (ioctl_t) &ws) != -1) { in GetSize()
1535 *cols = ws.ws_col; in GetSize()
1547 if (ioctl(SHIN, TIOCGSIZE, (ioctl_t) &ts) != -1) { in GetSize()
1549 *cols = ts.ts_cols; in GetSize()
1557 return (Val(T_co) != *cols || Val(T_li) != *lins); in GetSize()
1571 size_t len = (ptr - termcap) + Strlen(tag); in UpdateVal()
1586 ChangeSize(int lins, int cols) in ChangeSize() argument
1591 Val(T_co) = (cols < 2) ? 80 : cols; in ChangeSize()
1605 if (Val(T_co) == cols && Val(T_li) == lins) { in ChangeSize()
1630 termcap[TC_BUFSIZE-1] = '\0'; in ChangeSize()
1637 * Chop the termcap string at TC_BUFSIZE-1 characters to avoid in ChangeSize()
1638 * core-dumps in the termcap routines in ChangeSize()
1640 termcap[TC_BUFSIZE - 1] = '\0'; in ChangeSize()
1647 ReBufferDisplay(); /* re-make display buffers */ in ChangeSize()