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

Diff for /src/usr.bin/tmux/mode-tree.c between version 1.32 and 1.33

version 1.32, 2019/05/27 06:50:04 version 1.33, 2019/05/28 07:18:42
Line 35 
Line 35 
   
         struct window_pane       *wp;          struct window_pane       *wp;
         void                     *modedata;          void                     *modedata;
         const char               *menu;          const struct menu_item   *menu;
   
         const char              **sort_list;          const char              **sort_list;
         u_int                     sort_size;          u_int                     sort_size;
Line 100 
Line 100 
   
 static void mode_tree_free_items(struct mode_tree_list *);  static void mode_tree_free_items(struct mode_tree_list *);
   
 #define MODE_TREE_MENU \  static const struct menu_item mode_tree_menu_items[] = {
         "Scroll Left,<,|" \          { "Scroll Left", '<', NULL },
         "Scroll Right,>,|" \          { "Scroll Right", '>', NULL },
         "|" \          { "", KEYC_NONE, NULL },
         "Cancel,q,"          { "Cancel", 'q', NULL },
   
           { NULL, KEYC_NONE, NULL }
   };
   
 static struct mode_tree_item *  static struct mode_tree_item *
 mode_tree_find_item(struct mode_tree_list *mtl, uint64_t tag)  mode_tree_find_item(struct mode_tree_list *mtl, uint64_t tag)
 {  {
Line 315 
Line 318 
 mode_tree_start(struct window_pane *wp, struct args *args,  mode_tree_start(struct window_pane *wp, struct args *args,
     mode_tree_build_cb buildcb, mode_tree_draw_cb drawcb,      mode_tree_build_cb buildcb, mode_tree_draw_cb drawcb,
     mode_tree_search_cb searchcb, mode_tree_menu_cb menucb, void *modedata,      mode_tree_search_cb searchcb, mode_tree_menu_cb menucb, void *modedata,
     const char *menu, const char **sort_list, u_int sort_size,      const struct menu_item *menu, const char **sort_list, u_int sort_size,
     struct screen **s)      struct screen **s)
 {  {
         struct mode_tree_data   *mtd;          struct mode_tree_data   *mtd;
Line 812 
Line 815 
 {  {
         struct mode_tree_item   *mti;          struct mode_tree_item   *mti;
         struct menu             *menu;          struct menu             *menu;
           const struct menu_item  *items;
         struct mode_tree_menu   *mtm;          struct mode_tree_menu   *mtm;
         const char              *s;  
         char                    *title;          char                    *title;
         u_int                    line;          u_int                    line;
   
Line 824 
Line 827 
         mti = mtd->line_list[line].item;          mti = mtd->line_list[line].item;
   
         if (!outside) {          if (!outside) {
                 s = mtd->menu;                  items = mtd->menu;
                 xasprintf(&title, "#[align=centre]%s", mti->name);                  xasprintf(&title, "#[align=centre]%s", mti->name);
         } else {          } else {
                 s = MODE_TREE_MENU;                  items = mode_tree_menu_items;
                 title = xstrdup("");                  title = xstrdup("");
         }          }
         menu = menu_create(s, NULL, c, NULL, title);          menu = menu_create(title);
           menu_add_items(menu, items, NULL, NULL, NULL);
         free(title);          free(title);
         if (menu == NULL)  
                 return;  
   
         mtm = xmalloc(sizeof *mtm);          mtm = xmalloc(sizeof *mtm);
         mtm->data = mtd;          mtm->data = mtd;

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