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

Diff for /src/usr.bin/tmux/cmd-list-panes.c between version 1.33 and 1.34

version 1.33, 2017/05/01 12:20:55 version 1.34, 2020/04/12 08:36:18
Line 38 
Line 38 
         .name = "list-panes",          .name = "list-panes",
         .alias = "lsp",          .alias = "lsp",
   
         .args = { "asF:t:", 0, 0 },          .args = { "asF:f:t:", 0, 0 },
         .usage = "[-as] [-F format] " CMD_TARGET_WINDOW_USAGE,          .usage = "[-as] [-F format] [-f filter] " CMD_TARGET_WINDOW_USAGE,
   
         .target = { 't', CMD_FIND_WINDOW, 0 },          .target = { 't', CMD_FIND_WINDOW, 0 },
   
Line 91 
Line 91 
         struct window_pane      *wp;          struct window_pane      *wp;
         u_int                    n;          u_int                    n;
         struct format_tree      *ft;          struct format_tree      *ft;
         const char              *template;          const char              *template, *filter;
         char                    *line;          char                    *line, *expanded;
           int                      flag;
   
         template = args_get(args, 'F');          template = args_get(args, 'F');
         if (template == NULL) {          if (template == NULL) {
Line 120 
Line 121 
                         break;                          break;
                 }                  }
         }          }
           filter = args_get(args, 'f');
   
         n = 0;          n = 0;
         TAILQ_FOREACH(wp, &wl->window->panes, entry) {          TAILQ_FOREACH(wp, &wl->window->panes, entry) {
Line 127 
Line 129 
                 format_add(ft, "line", "%u", n);                  format_add(ft, "line", "%u", n);
                 format_defaults(ft, NULL, s, wl, wp);                  format_defaults(ft, NULL, s, wl, wp);
   
                 line = format_expand(ft, template);                  if (filter != NULL) {
                 cmdq_print(item, "%s", line);                          expanded = format_expand(ft, filter);
                 free(line);                          flag = format_true(expanded);
                           free(expanded);
                   } else
                           flag = 1;
                   if (flag) {
                           line = format_expand(ft, template);
                           cmdq_print(item, "%s", line);
                           free(line);
                   }
   
                 format_free(ft);                  format_free(ft);
                 n++;                  n++;

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34