[BACK]Return to term.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / vim

Diff for /src/usr.bin/vim/Attic/term.c between version 1.1 and 1.2

version 1.1, 1996/09/07 21:40:24 version 1.2, 1996/09/21 06:23:22
Line 365 
Line 365 
         {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"},
Line 633 
Line 637 
         {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 */
Line 832 
Line 838 
         {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
   
Line 1015 
Line 1025 
                                                         "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 {
Line 1051 
Line 1061 
                                 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"))
Line 1070 
Line 1080 
                                 {                                  {
                                         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) */
Line 1569 
Line 1579 
 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);
Line 1755 
Line 1767 
 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 */
   
Line 1974 
Line 1986 
         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 */
Line 2212 
Line 2225 
 #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
   
Line 2368 
Line 2381 
         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
Line 2475 
Line 2488 
                                 {                                  {
                                         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];

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2