version 1.1, 1996/09/07 21:40:24 |
version 1.2, 1996/09/21 06:23:22 |
|
|
{KS_MD, "\033|63m"}, |
{KS_MD, "\033|63m"}, |
{KS_SE, "\033|0m"}, |
{KS_SE, "\033|0m"}, |
{KS_SO, "\033|31m"}, |
{KS_SO, "\033|31m"}, |
|
{KS_CZH, "\033|225m"}, /* italic mode: blue text on yellow */ |
|
{KS_CZR, "\033|0m"}, /* italic mode end */ |
|
{KS_US, "\033|67m"}, /* underscore mode: cyan text on red */ |
|
{KS_UE, "\033|0m"}, /* underscore mode end */ |
{KS_MS, "\001"}, |
{KS_MS, "\001"}, |
# ifdef TERMINFO |
# ifdef TERMINFO |
{KS_CM, "\033|%i%p1%d;%p2%dH"}, |
{KS_CM, "\033|%i%p1%d;%p2%dH"}, |
|
|
{K_HELP, "\033[28~"}, |
{K_HELP, "\033[28~"}, |
{K_UNDO, "\033[26~"}, |
{K_UNDO, "\033[26~"}, |
{K_INS, "\033[2~"}, |
{K_INS, "\033[2~"}, |
{K_HOME, "\033[7~"}, /* also seen: "\033[1~" */ |
{K_HOME, "\033[7~"}, |
{K_END, "\033[8~"}, /* also seen: "\033[4~" */ |
{K_KHOME, "\033[1~"}, |
|
{K_END, "\033[8~"}, |
|
{K_KEND, "\033[4~"}, |
{K_PAGEUP, "\033[5~"}, |
{K_PAGEUP, "\033[5~"}, |
{K_PAGEDOWN, "\033[6~"}, |
{K_PAGEDOWN, "\033[6~"}, |
/* {K_DEL, "\033[3~"}, not used */ |
/* {K_DEL, "\033[3~"}, not used */ |
|
|
{K_END, "[END]"}, |
{K_END, "[END]"}, |
{K_PAGEUP, "[PAGEUP]"}, |
{K_PAGEUP, "[PAGEUP]"}, |
{K_PAGEDOWN, "[PAGEDOWN]"}, |
{K_PAGEDOWN, "[PAGEDOWN]"}, |
|
{K_KHOME, "[KHOME]"}, |
|
{K_KEND, "[KEND]"}, |
|
{K_KPAGEUP, "[KPAGEUP]"}, |
|
{K_KPAGEDOWN, "[KPAGEDOWN]"}, |
{K_MOUSE, "[MOUSE]"}, |
{K_MOUSE, "[MOUSE]"}, |
# endif |
# endif |
|
|
|
|
"k1", "k2", "k3", "k4", "k5", "k6", |
"k1", "k2", "k3", "k4", "k5", "k6", |
"k7", "k8", "k9", "k;", "F1", "F2", |
"k7", "k8", "k9", "k;", "F1", "F2", |
"%1", "&8", "kb", "kI", "kD", "kh", |
"%1", "&8", "kb", "kI", "kD", "kh", |
"@7", "kP", "kN", |
"@7", "kP", "kN", "K1", "K3", "K4", "K5", |
NULL |
NULL |
}; |
}; |
static struct { |
static struct { |
|
|
for (i = 0; string_names[i].name != NULL; ++i) |
for (i = 0; string_names[i].name != NULL; ++i) |
{ |
{ |
if (term_strings[string_names[i].dest] == NULL || |
if (term_strings[string_names[i].dest] == NULL || |
term_strings[string_names[i].dest] == empty_option) |
term_strings[string_names[i].dest] == empty_option) |
term_strings[string_names[i].dest] = |
term_strings[string_names[i].dest] = |
TGETSTR(string_names[i].name, &tp); |
TGETSTR(string_names[i].name, &tp); |
} |
} |
|
|
if ((T_MS == NULL || T_MS == empty_option) && tgetflag("ms")) |
if ((T_MS == NULL || T_MS == empty_option) && tgetflag("ms")) |
|
|
{ |
{ |
if (find_termcode((char_u *)key_names[i]) == NULL) |
if (find_termcode((char_u *)key_names[i]) == NULL) |
add_termcode((char_u *)key_names[i], |
add_termcode((char_u *)key_names[i], |
TGETSTR(key_names[i], &tp)); |
TGETSTR(key_names[i], &tp)); |
} |
} |
|
|
/* if cursor-left == backspace, ignore it (televideo 925) */ |
/* if cursor-left == backspace, ignore it (televideo 925) */ |
|
|
termcapinit(term) |
termcapinit(term) |
char_u *term; |
char_u *term; |
{ |
{ |
|
#ifndef WIN32 |
if (!term || !*term) |
if (!term || !*term) |
term = vim_getenv((char_u *)"TERM"); |
term = vim_getenv((char_u *)"TERM"); |
|
#endif |
if (!term || !*term) |
if (!term || !*term) |
term = DEFAULT_TERM; |
term = DEFAULT_TERM; |
set_string_option((char_u *)"term", -1, term, TRUE); |
set_string_option((char_u *)"term", -1, term, TRUE); |
|
|
ttest(pairs) |
ttest(pairs) |
int pairs; |
int pairs; |
{ |
{ |
char *t = NULL; |
char *t = NULL; |
|
|
check_options(); /* make sure no options are NULL */ |
check_options(); /* make sure no options are NULL */ |
|
|
|
|
if (!starting) |
if (!starting) |
{ |
{ |
comp_Botline_all(); |
comp_Botline_all(); |
|
maketitle(); |
if (State == ASKMORE || State == EXTERNCMD) |
if (State == ASKMORE || State == EXTERNCMD) |
{ |
{ |
screenalloc(FALSE); /* don't redraw, just adjust screen size */ |
screenalloc(FALSE); /* don't redraw, just adjust screen size */ |
|
|
#ifdef HAVE_TGETENT |
#ifdef HAVE_TGETENT |
BC = (char *)empty_option; |
BC = (char *)empty_option; |
UP = (char *)empty_option; |
UP = (char *)empty_option; |
PC = ' '; /* set pad character to space */ |
PC = NUL; /* set pad character to NUL */ |
ospeed = 0; |
ospeed = 0; |
#endif |
#endif |
|
|
|
|
int new_slen; |
int new_slen; |
int extra; |
int extra; |
char_u string[MAX_KEY_CODE_LEN + 1]; |
char_u string[MAX_KEY_CODE_LEN + 1]; |
int i; |
int i, j; |
#ifdef USE_GUI |
#ifdef USE_GUI |
long_u val; |
long_u val; |
#endif |
#endif |
|
|
{ |
{ |
if (len < slen) /* got a partial sequence */ |
if (len < slen) /* got a partial sequence */ |
return -1; /* need to get more chars */ |
return -1; /* need to get more chars */ |
|
|
|
/* |
|
* When found a keypad key, check if there is another key |
|
* that matches and use that one. This makes <Home> to be |
|
* found instead of <kHome> when they produce the same |
|
* key code. |
|
*/ |
|
if (termcodes[i].name[0] == 'K' && |
|
isdigit(termcodes[i].name[1])) |
|
{ |
|
for (j = i + 1; j < tc_len; ++j) |
|
if (termcodes[j].len == slen && |
|
STRNCMP(termcodes[i].code, |
|
termcodes[j].code, slen) == 0) |
|
{ |
|
i = j; |
|
break; |
|
} |
|
} |
|
|
key_name[0] = termcodes[i].name[0]; |
key_name[0] = termcodes[i].name[0]; |
key_name[1] = termcodes[i].name[1]; |
key_name[1] = termcodes[i].name[1]; |