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

Diff for /src/usr.bin/tmux/format.c between version 1.316 and 1.317

version 1.316, 2023/07/10 09:24:53 version 1.317, 2023/08/17 14:10:28
Line 1191 
Line 1191 
         return (format_grid_line(gd, gd->hsize + y));          return (format_grid_line(gd, gd->hsize + y));
 }  }
   
   /* Callback for mouse_status_line. */
   static void *
   format_cb_mouse_status_line(struct format_tree *ft)
   {
           char    *value;
           u_int    y;
   
           if (!ft->m.valid)
                   return (NULL);
           if (ft->c == NULL || (~ft->c->tty.flags & TTY_STARTED))
                   return (NULL);
   
           if (ft->m.statusat == 0 && ft->m.y < ft->m.statuslines) {
                   y = ft->m.y;
           } else if (ft->m.statusat > 0 && ft->m.y >= (u_int)ft->m.statusat) {
                   y = ft->m.y - ft->m.statusat;
           } else
                   return (NULL);
           xasprintf(&value, "%u", y);
           return (value);
   
   }
   
   /* Callback for mouse_status_range. */
   static void *
   format_cb_mouse_status_range(struct format_tree *ft)
   {
           struct style_range      *sr;
           u_int                    x, y;
   
           if (!ft->m.valid)
                   return (NULL);
           if (ft->c == NULL || (~ft->c->tty.flags & TTY_STARTED))
                   return (NULL);
   
           if (ft->m.statusat == 0 && ft->m.y < ft->m.statuslines) {
                   x = ft->m.x;
                   y = ft->m.y;
           } else if (ft->m.statusat > 0 && ft->m.y >= (u_int)ft->m.statusat) {
                   x = ft->m.x;
                   y = ft->m.y - ft->m.statusat;
           } else
                   return (NULL);
   
           sr = status_get_range(ft->c, x, y);
           if (sr == NULL)
                   return (NULL);
           switch (sr->type) {
           case STYLE_RANGE_NONE:
                   return (NULL);
           case STYLE_RANGE_LEFT:
                   return (xstrdup("left"));
           case STYLE_RANGE_RIGHT:
                   return (xstrdup("right"));
           case STYLE_RANGE_PANE:
                   return (xstrdup("pane"));
           case STYLE_RANGE_WINDOW:
                   return (xstrdup("window"));
           case STYLE_RANGE_SESSION:
                   return (xstrdup("session"));
           case STYLE_RANGE_USER:
                   return (xstrdup(sr->string));
           }
           return (NULL);
   }
   
 /* Callback for alternate_on. */  /* Callback for alternate_on. */
 static void *  static void *
 format_cb_alternate_on(struct format_tree *ft)  format_cb_alternate_on(struct format_tree *ft)
Line 2847 
Line 2913 
         },          },
         { "mouse_standard_flag", FORMAT_TABLE_STRING,          { "mouse_standard_flag", FORMAT_TABLE_STRING,
           format_cb_mouse_standard_flag            format_cb_mouse_standard_flag
           },
           { "mouse_status_line", FORMAT_TABLE_STRING,
             format_cb_mouse_status_line
           },
           { "mouse_status_range", FORMAT_TABLE_STRING,
             format_cb_mouse_status_range
         },          },
         { "mouse_utf8_flag", FORMAT_TABLE_STRING,          { "mouse_utf8_flag", FORMAT_TABLE_STRING,
           format_cb_mouse_utf8_flag            format_cb_mouse_utf8_flag

Legend:
Removed from v.1.316  
changed lines
  Added in v.1.317