[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.227 and 1.228

version 1.227, 2020/03/19 13:43:18 version 1.228, 2020/03/20 17:59:39
Line 948 
Line 948 
   
         ws = options_get_string(global_s_options, "word-separators");          ws = options_get_string(global_s_options, "word-separators");
   
         y = gd->hsize + y;  
         for (;;) {          for (;;) {
                 grid_get_cell(gd, x, y, &gc);                  grid_get_cell(gd, x, y, &gc);
                 if (gc.flags & GRID_FLAG_PADDING)                  if (gc.flags & GRID_FLAG_PADDING)
Line 1009 
Line 1008 
 format_cb_mouse_word(struct format_tree *ft, struct format_entry *fe)  format_cb_mouse_word(struct format_tree *ft, struct format_entry *fe)
 {  {
         struct window_pane      *wp;          struct window_pane      *wp;
           struct grid             *gd;
         u_int                    x, y;          u_int                    x, y;
         char                    *s;          char                    *s;
   
Line 1017 
Line 1017 
         wp = cmd_mouse_pane(&ft->m, NULL, NULL);          wp = cmd_mouse_pane(&ft->m, NULL, NULL);
         if (wp == NULL)          if (wp == NULL)
                 return;                  return;
         if (!TAILQ_EMPTY (&wp->modes))  
                 return;  
         if (cmd_mouse_at(wp, &ft->m, &x, &y, 0) != 0)          if (cmd_mouse_at(wp, &ft->m, &x, &y, 0) != 0)
                 return;                  return;
   
         s = format_grid_word(wp->base.grid, x, y);          if (!TAILQ_EMPTY(&wp->modes)) {
                   if (TAILQ_FIRST(&wp->modes)->mode == &window_copy_mode)
                           s = window_copy_get_word(wp, x, y);
                   else
                           s = NULL;
           } else {
                   gd = wp->base.grid;
                   s = format_grid_word(gd, x, gd->hsize + y);
           }
         if (s != NULL)          if (s != NULL)
                 fe->value = s;                  fe->value = s;
 }  }
Line 1037 
Line 1043 
         size_t                   size = 0;          size_t                   size = 0;
         char                    *s = NULL;          char                    *s = NULL;
   
         y = gd->hsize + y;  
         for (x = 0; x < grid_line_length(gd, y); x++) {          for (x = 0; x < grid_line_length(gd, y); x++) {
                 grid_get_cell(gd, x, y, &gc);                  grid_get_cell(gd, x, y, &gc);
                 if (gc.flags & GRID_FLAG_PADDING)                  if (gc.flags & GRID_FLAG_PADDING)
Line 1059 
Line 1064 
 format_cb_mouse_line(struct format_tree *ft, struct format_entry *fe)  format_cb_mouse_line(struct format_tree *ft, struct format_entry *fe)
 {  {
         struct window_pane      *wp;          struct window_pane      *wp;
           struct grid             *gd;
         u_int                    x, y;          u_int                    x, y;
         char                    *s;          char                    *s;
   
Line 1067 
Line 1073 
         wp = cmd_mouse_pane(&ft->m, NULL, NULL);          wp = cmd_mouse_pane(&ft->m, NULL, NULL);
         if (wp == NULL)          if (wp == NULL)
                 return;                  return;
         if (!TAILQ_EMPTY (&wp->modes))  
                 return;  
         if (cmd_mouse_at(wp, &ft->m, &x, &y, 0) != 0)          if (cmd_mouse_at(wp, &ft->m, &x, &y, 0) != 0)
                 return;                  return;
   
         s = format_grid_line(wp->base.grid, y);          if (!TAILQ_EMPTY(&wp->modes)) {
                   if (TAILQ_FIRST(&wp->modes)->mode == &window_copy_mode)
                           s = window_copy_get_line(wp, y);
                   else
                           s = NULL;
           } else {
                   gd = wp->base.grid;
                   s = format_grid_line(gd, gd->hsize + y);
           }
         if (s != NULL)          if (s != NULL)
                 fe->value = s;                  fe->value = s;
 }  }

Legend:
Removed from v.1.227  
changed lines
  Added in v.1.228