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

Diff for /src/usr.bin/tmux/cmd-select-window.c between version 1.7 and 1.8

version 1.7, 2011/04/05 19:37:01 version 1.8, 2012/07/11 07:10:15
Line 26 
Line 26 
  * Select window by index.   * Select window by index.
  */   */
   
 void    cmd_select_window_key_binding(struct cmd *, int);  void             cmd_select_window_key_binding(struct cmd *, int);
 int     cmd_select_window_exec(struct cmd *, struct cmd_ctx *);  enum cmd_retval  cmd_select_window_exec(struct cmd *, struct cmd_ctx *);
   
 const struct cmd_entry cmd_select_window_entry = {  const struct cmd_entry cmd_select_window_entry = {
         "select-window", "selectw",          "select-window", "selectw",
Line 83 
Line 83 
                 args_set(self->args, 'a', NULL);                  args_set(self->args, 'a', NULL);
 }  }
   
 int  enum cmd_retval
 cmd_select_window_exec(struct cmd *self, struct cmd_ctx *ctx)  cmd_select_window_exec(struct cmd *self, struct cmd_ctx *ctx)
 {  {
         struct args     *args = self->args;          struct args     *args = self->args;
Line 104 
Line 104 
         if (next || previous || last) {          if (next || previous || last) {
                 s = cmd_find_session(ctx, args_get(args, 't'), 0);                  s = cmd_find_session(ctx, args_get(args, 't'), 0);
                 if (s == NULL)                  if (s == NULL)
                         return (-1);                          return (CMD_RETURN_ERROR);
   
                 activity = args_has(self->args, 'a');                  activity = args_has(self->args, 'a');
                 if (next) {                  if (next) {
                         if (session_next(s, activity) != 0) {                          if (session_next(s, activity) != 0) {
                                 ctx->error(ctx, "no next window");                                  ctx->error(ctx, "no next window");
                                 return (-1);                                  return (CMD_RETURN_ERROR);
                         }                          }
                 } else if (previous) {                  } else if (previous) {
                         if (session_previous(s, activity) != 0) {                          if (session_previous(s, activity) != 0) {
                                 ctx->error(ctx, "no previous window");                                  ctx->error(ctx, "no previous window");
                                 return (-1);                                  return (CMD_RETURN_ERROR);
                         }                          }
                 } else {                  } else {
                         if (session_last(s) != 0) {                          if (session_last(s) != 0) {
                                 ctx->error(ctx, "no last window");                                  ctx->error(ctx, "no last window");
                                 return (-1);                                  return (CMD_RETURN_ERROR);
                         }                          }
                 }                  }
   
Line 128 
Line 128 
         } else {          } else {
                 wl = cmd_find_window(ctx, args_get(args, 't'), &s);                  wl = cmd_find_window(ctx, args_get(args, 't'), &s);
                 if (wl == NULL)                  if (wl == NULL)
                         return (-1);                          return (CMD_RETURN_ERROR);
   
                 if (session_select(s, wl->idx) == 0)                  if (session_select(s, wl->idx) == 0)
                         server_redraw_session(s);                          server_redraw_session(s);
         }          }
         recalculate_sizes();          recalculate_sizes();
   
         return (0);          return (CMD_RETURN_NORMAL);
 }  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8