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

Diff for /src/usr.bin/tmux/input.c between version 1.124 and 1.125

version 1.124, 2017/06/04 09:02:36 version 1.125, 2017/06/04 09:22:34
Line 93 
Line 93 
   
         const struct input_state *state;          const struct input_state *state;
   
           struct event            timer;
   
         /*          /*
          * All input received since we were last in the ground state. Sent to           * All input received since we were last in the ground state. Sent to
          * control clients on connection.           * control clients on connection.
Line 118 
Line 120 
 /* Transition entry/exit handlers. */  /* Transition entry/exit handlers. */
 static void     input_clear(struct input_ctx *);  static void     input_clear(struct input_ctx *);
 static void     input_ground(struct input_ctx *);  static void     input_ground(struct input_ctx *);
   static void     input_enter_dcs(struct input_ctx *);
 static void     input_enter_osc(struct input_ctx *);  static void     input_enter_osc(struct input_ctx *);
 static void     input_exit_osc(struct input_ctx *);  static void     input_exit_osc(struct input_ctx *);
 static void     input_enter_apc(struct input_ctx *);  static void     input_enter_apc(struct input_ctx *);
Line 364 
Line 367 
 /* dcs_enter state definition. */  /* dcs_enter state definition. */
 static const struct input_state input_state_dcs_enter = {  static const struct input_state input_state_dcs_enter = {
         "dcs_enter",          "dcs_enter",
         input_clear, NULL,          input_enter_dcs, NULL,
         input_state_dcs_enter_table          input_state_dcs_enter_table
 };  };
   
Line 756 
Line 759 
         return (strcmp(ictx->interm_buf, entry->interm));          return (strcmp(ictx->interm_buf, entry->interm));
 }  }
   
   /*
    * Timer - if this expires then have been waiting for a terminator for too
    * long, so reset to ground.
    */
   static void
   input_timer_callback(__unused int fd, __unused short events, void *arg)
   {
           struct input_ctx        *ictx = arg;
           struct window_pane      *wp = ictx->wp;
   
           log_debug("%s: %%%u %s expired" , __func__, wp->id, ictx->state->name);
           input_reset(wp, 0);
   }
   
   /* Start the timer. */
   static void
   input_start_timer(struct input_ctx *ictx)
   {
           struct timeval  tv = { .tv_usec = 100000 };
   
           event_del(&ictx->timer);
           event_add(&ictx->timer, &tv);
   }
   
 /* Reset cell state to default. */  /* Reset cell state to default. */
 static void  static void
 input_reset_cell(struct input_ctx *ictx)  input_reset_cell(struct input_ctx *ictx)
Line 782 
Line 809 
   
         ictx->since_ground = evbuffer_new();          ictx->since_ground = evbuffer_new();
   
           evtimer_set(&ictx->timer, input_timer_callback, ictx);
   
         input_reset(wp, 0);          input_reset(wp, 0);
 }  }
   
Line 791 
Line 820 
 {  {
         struct input_ctx        *ictx = wp->ictx;          struct input_ctx        *ictx = wp->ictx;
   
           event_del(&ictx->timer);
   
         free(ictx->input_buf);          free(ictx->input_buf);
         evbuffer_free(ictx->since_ground);          evbuffer_free(ictx->since_ground);
   
Line 815 
Line 846 
                 screen_write_stop(&ictx->ctx);                  screen_write_stop(&ictx->ctx);
         }          }
   
         *ictx->interm_buf = '\0';          input_clear(ictx);
         ictx->interm_len = 0;  
   
         *ictx->param_buf = '\0';  
         ictx->param_len = 0;  
   
         *ictx->input_buf = '\0';  
         ictx->input_len = 0;  
   
         ictx->state = &input_state_ground;          ictx->state = &input_state_ground;
         ictx->flags = 0;          ictx->flags = 0;
 }  }
Line 997 
Line 1021 
 static void  static void
 input_clear(struct input_ctx *ictx)  input_clear(struct input_ctx *ictx)
 {  {
           event_del(&ictx->timer);
   
         *ictx->interm_buf = '\0';          *ictx->interm_buf = '\0';
         ictx->interm_len = 0;          ictx->interm_len = 0;
   
Line 1013 
Line 1039 
 static void  static void
 input_ground(struct input_ctx *ictx)  input_ground(struct input_ctx *ictx)
 {  {
           event_del(&ictx->timer);
         evbuffer_drain(ictx->since_ground, EVBUFFER_LENGTH(ictx->since_ground));          evbuffer_drain(ictx->since_ground, EVBUFFER_LENGTH(ictx->since_ground));
   
         if (ictx->input_space > INPUT_BUF_START) {          if (ictx->input_space > INPUT_BUF_START) {
Line 1842 
Line 1869 
         }          }
 }  }
   
   /* DCS string started. */
   static void
   input_enter_dcs(struct input_ctx *ictx)
   {
           log_debug("%s", __func__);
   
           input_clear(ictx);
           input_start_timer(ictx);
   }
   
 /* DCS terminator (ST) received. */  /* DCS terminator (ST) received. */
 static int  static int
 input_dcs_dispatch(struct input_ctx *ictx)  input_dcs_dispatch(struct input_ctx *ictx)
Line 1871 
Line 1908 
         log_debug("%s", __func__);          log_debug("%s", __func__);
   
         input_clear(ictx);          input_clear(ictx);
           input_start_timer(ictx);
 }  }
   
 /* OSC terminator (ST) received. */  /* OSC terminator (ST) received. */
Line 1937 
Line 1975 
         log_debug("%s", __func__);          log_debug("%s", __func__);
   
         input_clear(ictx);          input_clear(ictx);
           input_start_timer(ictx);
 }  }
   
 /* APC terminator (ST) received. */  /* APC terminator (ST) received. */
Line 1960 
Line 1999 
         log_debug("%s", __func__);          log_debug("%s", __func__);
   
         input_clear(ictx);          input_clear(ictx);
           input_start_timer(ictx);
 }  }
   
 /* Rename terminator (ST) received. */  /* Rename terminator (ST) received. */

Legend:
Removed from v.1.124  
changed lines
  Added in v.1.125