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

Diff for /src/usr.bin/tmux/window-copy.c between version 1.73 and 1.74

version 1.73, 2011/06/27 00:04:49 version 1.74, 2011/10/23 23:38:16
Line 52 
Line 52 
 void    window_copy_update_cursor(struct window_pane *, u_int, u_int);  void    window_copy_update_cursor(struct window_pane *, u_int, u_int);
 void    window_copy_start_selection(struct window_pane *);  void    window_copy_start_selection(struct window_pane *);
 int     window_copy_update_selection(struct window_pane *);  int     window_copy_update_selection(struct window_pane *);
 void    window_copy_copy_selection(struct window_pane *);  void    window_copy_copy_selection(struct window_pane *, int);
 void    window_copy_clear_selection(struct window_pane *);  void    window_copy_clear_selection(struct window_pane *);
 void    window_copy_copy_line(  void    window_copy_copy_line(
             struct window_pane *, char **, size_t *, u_int, u_int, u_int);              struct window_pane *, char **, size_t *, u_int, u_int, u_int);
Line 134 
Line 134 
         const char     *inputprompt;          const char     *inputprompt;
         char           *inputstr;          char           *inputstr;
   
         u_int           numprefix;          int             numprefix;
   
         enum window_copy_input_type searchtype;          enum window_copy_input_type searchtype;
         char           *searchstr;          char           *searchstr;
Line 165 
Line 165 
         data->inputtype = WINDOW_COPY_OFF;          data->inputtype = WINDOW_COPY_OFF;
         data->inputprompt = NULL;          data->inputprompt = NULL;
         data->inputstr = xstrdup("");          data->inputstr = xstrdup("");
         data->numprefix = 0;          data->numprefix = -1;
   
         data->searchtype = WINDOW_COPY_OFF;          data->searchtype = WINDOW_COPY_OFF;
         data->searchstr = NULL;          data->searchstr = NULL;
Line 358 
Line 358 
         const char                      *word_separators;          const char                      *word_separators;
         struct window_copy_mode_data    *data = wp->modedata;          struct window_copy_mode_data    *data = wp->modedata;
         struct screen                   *s = &data->screen;          struct screen                   *s = &data->screen;
         u_int                            n, np;          u_int                            n;
         int                              keys;          int                              np, keys;
         enum mode_key_cmd                cmd;          enum mode_key_cmd                cmd;
   
         np = data->numprefix;          np = data->numprefix;
         if (np == 0)          if (np <= 0)
                 np = 1;                  np = 1;
   
         if (data->inputtype == WINDOW_COPY_JUMPFORWARD ||          if (data->inputtype == WINDOW_COPY_JUMPFORWARD ||
Line 513 
Line 513 
                 if (sess != NULL &&                  if (sess != NULL &&
                     (cmd == MODEKEYCOPY_COPYLINE ||                      (cmd == MODEKEYCOPY_COPYLINE ||
                     cmd == MODEKEYCOPY_COPYENDOFLINE)) {                      cmd == MODEKEYCOPY_COPYENDOFLINE)) {
                         window_copy_copy_selection(wp);                          window_copy_copy_selection(wp, -1);
                         window_pane_reset_mode(wp);                          window_pane_reset_mode(wp);
                         return;                          return;
                 }                  }
Line 524 
Line 524 
                 break;                  break;
         case MODEKEYCOPY_COPYSELECTION:          case MODEKEYCOPY_COPYSELECTION:
                 if (sess != NULL) {                  if (sess != NULL) {
                         window_copy_copy_selection(wp);                          window_copy_copy_selection(wp, data->numprefix);
                         window_pane_reset_mode(wp);                          window_pane_reset_mode(wp);
                         return;                          return;
                 }                  }
Line 664 
Line 664 
                 break;                  break;
         }          }
   
         data->numprefix = 0;          data->numprefix = -1;
         return;          return;
   
 input_on:  input_on:
Line 696 
Line 696 
         struct window_copy_mode_data    *data = wp->modedata;          struct window_copy_mode_data    *data = wp->modedata;
         struct screen                   *s = &data->screen;          struct screen                   *s = &data->screen;
         size_t                           inputlen;          size_t                           inputlen;
         u_int                            np;          int                              np;
   
         switch (mode_key_lookup(&data->mdata, key)) {          switch (mode_key_lookup(&data->mdata, key)) {
         case MODEKEYEDIT_CANCEL:          case MODEKEYEDIT_CANCEL:
                 data->numprefix = 0;                  data->numprefix = -1;
                 return (-1);                  return (-1);
         case MODEKEYEDIT_BACKSPACE:          case MODEKEYEDIT_BACKSPACE:
                 inputlen = strlen(data->inputstr);                  inputlen = strlen(data->inputstr);
Line 712 
Line 712 
                 break;                  break;
         case MODEKEYEDIT_ENTER:          case MODEKEYEDIT_ENTER:
                 np = data->numprefix;                  np = data->numprefix;
                 if (np == 0)                  if (np <= 0)
                         np = 1;                          np = 1;
   
                 switch (data->inputtype) {                  switch (data->inputtype) {
Line 738 
Line 738 
                         *data->inputstr = '\0';                          *data->inputstr = '\0';
                         break;                          break;
                 }                  }
                 data->numprefix = 0;                  data->numprefix = -1;
                 return (1);                  return (1);
         case MODEKEY_OTHER:          case MODEKEY_OTHER:
                 if (key < 32 || key > 126)                  if (key < 32 || key > 126)
Line 767 
Line 767 
         if (key < '0' || key > '9')          if (key < '0' || key > '9')
                 return 1;                  return 1;
   
         if (data->numprefix >= 100)     /* no more than three digits */          if (data->numprefix >= 100)     /* no more than three digits */
                 return 0;                  return 0;
         data->numprefix = data->numprefix * 10 + key - '0';          data->numprefix = data->numprefix * 10 + key - '0';
   
Line 834 
Line 834 
         s->mode &= ~MODE_MOUSE_BUTTON;          s->mode &= ~MODE_MOUSE_BUTTON;
         s->mode |= MODE_MOUSE_STANDARD;          s->mode |= MODE_MOUSE_STANDARD;
         if (sess != NULL) {          if (sess != NULL) {
                 window_copy_copy_selection(wp);                  window_copy_copy_selection(wp, -1);
                 window_pane_reset_mode(wp);                  window_pane_reset_mode(wp);
         }          }
 }  }
Line 1235 
Line 1235 
 }  }
   
 void  void
 window_copy_copy_selection(struct window_pane *wp)  window_copy_copy_selection(struct window_pane *wp, int idx)
 {  {
         struct window_copy_mode_data    *data = wp->modedata;          struct window_copy_mode_data    *data = wp->modedata;
         struct screen                   *s = &data->screen;          struct screen                   *s = &data->screen;
Line 1315 
Line 1315 
         } else {          } else {
                 if (keys == MODEKEY_EMACS)                  if (keys == MODEKEY_EMACS)
                         lastex = ex;                          lastex = ex;
                 else                  else
                         lastex = ex + 1;                          lastex = ex + 1;
                 restex = xx;                  restex = xx;
                 firstsx = sx;                  firstsx = sx;
Line 1347 
Line 1347 
                 screen_write_setselection(&wp->ictx.ctx, buf, off);                  screen_write_setselection(&wp->ictx.ctx, buf, off);
   
         /* Add the buffer to the stack. */          /* Add the buffer to the stack. */
         limit = options_get_number(&global_options, "buffer-limit");          if (idx == -1) {
         paste_add(&global_buffers, buf, off, limit);                  limit = options_get_number(&global_options, "buffer-limit");
                   paste_add(&global_buffers, buf, off, limit);
           } else
                   paste_replace(&global_buffers, idx, buf, off);
 }  }
   
 void  void

Legend:
Removed from v.1.73  
changed lines
  Added in v.1.74