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

Diff for /src/usr.bin/tmux/cmd-break-pane.c between version 1.55 and 1.56

version 1.55, 2020/04/13 20:51:57 version 1.56, 2020/04/22 21:15:33
Line 34 
Line 34 
         .name = "break-pane",          .name = "break-pane",
         .alias = "breakp",          .alias = "breakp",
   
         .args = { "dPF:n:s:t:", 0, 0 },          .args = { "adPF:n:s:t:", 0, 0 },
         .usage = "[-dP] [-F format] [-n window-name] [-s src-pane] "          .usage = "[-adP] [-F format] [-n window-name] [-s src-pane] "
                  "[-t dst-window]",                   "[-t dst-window]",
   
         .source = { 's', CMD_FIND_PANE, 0 },          .source = { 's', CMD_FIND_PANE, 0 },
Line 63 
Line 63 
         const char              *template;          const char              *template;
         char                    *cp;          char                    *cp;
   
         if (idx != -1 && winlink_find_by_index(&dst_s->windows, idx) != NULL) {          if (args_has(args, 'a')) {
                 cmdq_error(item, "index %d already in use", idx);                  if (target->wl != NULL)
                 return (CMD_RETURN_ERROR);                          idx = winlink_shuffle_up(dst_s, target->wl);
                   else
                           idx = winlink_shuffle_up(dst_s, dst_s->curw);
                   if (idx == -1)
                           return (CMD_RETURN_ERROR);
         }          }
           server_unzoom_window(w);
   
         if (window_count_panes(w) == 1) {          if (window_count_panes(w) == 1) {
                 cmdq_error(item, "can't break with only one pane");                  if (server_link_window(src_s, wl, dst_s, idx, 0,
                       !args_has(args, 'd'), &cause) != 0) {
                           cmdq_error(item, "%s", cause);
                           free(cause);
                           return (CMD_RETURN_ERROR);
                   }
                   server_unlink_window(src_s, wl);
                   return (CMD_RETURN_NORMAL);
           }
           if (idx != -1 && winlink_find_by_index(&dst_s->windows, idx) != NULL) {
                   cmdq_error(item, "index in use: %d", idx);
                 return (CMD_RETURN_ERROR);                  return (CMD_RETURN_ERROR);
         }          }
         server_unzoom_window(w);  
   
         TAILQ_REMOVE(&w->panes, wp, entry);          TAILQ_REMOVE(&w->panes, wp, entry);
         window_lost_pane(w, wp);          window_lost_pane(w, wp);

Legend:
Removed from v.1.55  
changed lines
  Added in v.1.56