[BACK]Return to server-client.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/server-client.c between version 1.190 and 1.191

version 1.190, 2016/10/10 21:29:23 version 1.191, 2016/10/11 07:23:34
Line 97 
Line 97 
         return (name);          return (name);
 }  }
   
   /* Is this client using the default key table? */
   int
   server_client_is_default_key_table(struct client *c)
   {
           return (strcmp(c->keytable->name, server_client_get_key_table(c)) == 0);
   }
   
 /* Create a new client. */  /* Create a new client. */
 void  void
 server_client_create(int fd)  server_client_create(int fd)
Line 587 
Line 594 
         struct window           *w;          struct window           *w;
         struct window_pane      *wp;          struct window_pane      *wp;
         struct timeval           tv;          struct timeval           tv;
           const char              *name;
         struct key_table        *table;          struct key_table        *table;
         struct key_binding       bd_find, *bd;          struct key_binding       bd_find, *bd;
         int                      xtimeout;          int                      xtimeout;
Line 595 
Line 603 
         if (s == NULL || (c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0)          if (s == NULL || (c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0)
                 return;                  return;
         w = s->curw->window;          w = s->curw->window;
           if (KEYC_IS_MOUSE(key))
                   wp = cmd_mouse_pane(m, NULL, NULL);
           else
                   wp = w->active;
   
         /* Update the activity timer. */          /* Update the activity timer. */
         if (gettimeofday(&c->activity_time, NULL) != 0)          if (gettimeofday(&c->activity_time, NULL) != 0)
Line 645 
Line 657 
                 goto forward;                  goto forward;
   
 retry:  retry:
           /*
            * Work out the current key table. If the pane is in a mode, use
            * the mode table instead of the default key table.
            */
           name = NULL;
           if (wp != NULL && wp->mode != NULL && wp->mode->key_table != NULL)
                   name = wp->mode->key_table(wp);
           if (name == NULL || !server_client_is_default_key_table(c))
                   table = c->keytable;
           else
                   table = key_bindings_get_table(name, 1);
   
         /* Try to see if there is a key binding in the current table. */          /* Try to see if there is a key binding in the current table. */
         bd_find.key = key;          bd_find.key = key;
         bd = RB_FIND(key_bindings, &c->keytable->key_bindings, &bd_find);          bd = RB_FIND(key_bindings, &table->key_bindings, &bd_find);
         if (bd != NULL) {          if (bd != NULL) {
                 /*                  /*
                  * Key was matched in this table. If currently repeating but a                   * Key was matched in this table. If currently repeating but a
Line 665 
Line 689 
                  * Take a reference to this table to make sure the key binding                   * Take a reference to this table to make sure the key binding
                  * doesn't disappear.                   * doesn't disappear.
                  */                   */
                 table = c->keytable;  
                 table->references++;                  table->references++;
   
                 /*                  /*
Line 704 
Line 727 
         }          }
   
         /* If no match and we're not in the root table, that's it. */          /* If no match and we're not in the root table, that's it. */
         if (strcmp(c->keytable->name, server_client_get_key_table(c)) != 0) {          if (name == NULL && !server_client_is_default_key_table(c)) {
                 server_client_set_key_table(c, NULL);                  server_client_set_key_table(c, NULL);
                 server_status_client(c);                  server_status_client(c);
                 return;                  return;
Line 724 
Line 747 
 forward:  forward:
         if (c->flags & CLIENT_READONLY)          if (c->flags & CLIENT_READONLY)
                 return;                  return;
         if (KEYC_IS_MOUSE(key))  
                 wp = cmd_mouse_pane(m, NULL, NULL);  
         else  
                 wp = w->active;  
         if (wp != NULL)          if (wp != NULL)
                 window_pane_key(wp, c, s, key, m);                  window_pane_key(wp, c, s, key, m);
 }  }

Legend:
Removed from v.1.190  
changed lines
  Added in v.1.191