summaryrefslogtreecommitdiff
path: root/usr.bin/vim/term.c
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1996-09-21 06:23:56 +0000
committerJason Downs <downsj@cvs.openbsd.org>1996-09-21 06:23:56 +0000
commite8e01073071369d33ab4cf61be05bebe5a65566e (patch)
tree2c29b23bfb933e0fa40619f7d1fae430ff2c247e /usr.bin/vim/term.c
parent584e4bbf452da2934dbaf4b9dc09bd131a1d4cd7 (diff)
update to vim 4.4beta
Diffstat (limited to 'usr.bin/vim/term.c')
-rw-r--r--usr.bin/vim/term.c52
1 files changed, 42 insertions, 10 deletions
diff --git a/usr.bin/vim/term.c b/usr.bin/vim/term.c
index 502c722ebae..cc7e4483580 100644
--- a/usr.bin/vim/term.c
+++ b/usr.bin/vim/term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: term.c,v 1.1 1996/09/07 21:40:24 downsj Exp $ */
+/* $OpenBSD: term.c,v 1.2 1996/09/21 06:23:22 downsj Exp $ */
/* vi:set ts=4 sw=4:
*
* VIM - Vi IMproved by Bram Moolenaar
@@ -365,6 +365,10 @@ struct builtin_term builtin_termcaps[] =
{KS_MD, "\033|63m"},
{KS_SE, "\033|0m"},
{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"},
# ifdef TERMINFO
{KS_CM, "\033|%i%p1%d;%p2%dH"},
@@ -633,8 +637,10 @@ struct builtin_term builtin_termcaps[] =
{K_HELP, "\033[28~"},
{K_UNDO, "\033[26~"},
{K_INS, "\033[2~"},
- {K_HOME, "\033[7~"}, /* also seen: "\033[1~" */
- {K_END, "\033[8~"}, /* also seen: "\033[4~" */
+ {K_HOME, "\033[7~"},
+ {K_KHOME, "\033[1~"},
+ {K_END, "\033[8~"},
+ {K_KEND, "\033[4~"},
{K_PAGEUP, "\033[5~"},
{K_PAGEDOWN, "\033[6~"},
/* {K_DEL, "\033[3~"}, not used */
@@ -832,6 +838,10 @@ struct builtin_term builtin_termcaps[] =
{K_END, "[END]"},
{K_PAGEUP, "[PAGEUP]"},
{K_PAGEDOWN, "[PAGEDOWN]"},
+ {K_KHOME, "[KHOME]"},
+ {K_KEND, "[KEND]"},
+ {K_KPAGEUP, "[KPAGEUP]"},
+ {K_KPAGEDOWN, "[KPAGEDOWN]"},
{K_MOUSE, "[MOUSE]"},
# endif
@@ -1015,7 +1025,7 @@ set_termname(term)
"k1", "k2", "k3", "k4", "k5", "k6",
"k7", "k8", "k9", "k;", "F1", "F2",
"%1", "&8", "kb", "kI", "kD", "kh",
- "@7", "kP", "kN",
+ "@7", "kP", "kN", "K1", "K3", "K4", "K5",
NULL
};
static struct {
@@ -1051,9 +1061,9 @@ set_termname(term)
for (i = 0; string_names[i].name != NULL; ++i)
{
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] =
- TGETSTR(string_names[i].name, &tp);
+ TGETSTR(string_names[i].name, &tp);
}
if ((T_MS == NULL || T_MS == empty_option) && tgetflag("ms"))
@@ -1070,7 +1080,7 @@ set_termname(term)
{
if (find_termcode((char_u *)key_names[i]) == NULL)
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) */
@@ -1569,8 +1579,10 @@ tgoto(cm, x, y)
termcapinit(term)
char_u *term;
{
+#ifndef WIN32
if (!term || !*term)
term = vim_getenv((char_u *)"TERM");
+#endif
if (!term || !*term)
term = DEFAULT_TERM;
set_string_option((char_u *)"term", -1, term, TRUE);
@@ -1755,7 +1767,7 @@ setcursor()
ttest(pairs)
int pairs;
{
- char *t = NULL;
+ char *t = NULL;
check_options(); /* make sure no options are NULL */
@@ -1974,6 +1986,7 @@ set_winsize(width, height, mustset)
if (!starting)
{
comp_Botline_all();
+ maketitle();
if (State == ASKMORE || State == EXTERNCMD)
{
screenalloc(FALSE); /* don't redraw, just adjust screen size */
@@ -2212,7 +2225,7 @@ clear_termcodes()
#ifdef HAVE_TGETENT
BC = (char *)empty_option;
UP = (char *)empty_option;
- PC = ' '; /* set pad character to space */
+ PC = NUL; /* set pad character to NUL */
ospeed = 0;
#endif
@@ -2368,7 +2381,7 @@ check_termcode(max_offset)
int new_slen;
int extra;
char_u string[MAX_KEY_CODE_LEN + 1];
- int i;
+ int i, j;
#ifdef USE_GUI
long_u val;
#endif
@@ -2476,6 +2489,25 @@ check_termcode(max_offset)
if (len < slen) /* got a partial sequence */
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[1] = termcodes[i].name[1];