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

Diff for /src/usr.bin/tmux/window-copy.c between version 1.169 and 1.170

version 1.169, 2017/03/21 09:51:00 version 1.170, 2017/03/24 07:14:27
Line 174 
Line 174 
         int              searchtype;          int              searchtype;
         char            *searchstr;          char            *searchstr;
         bitstr_t        *searchmark;          bitstr_t        *searchmark;
           u_int            searchcount;
           int              searchthis;
         int              searchx;          int              searchx;
         int              searchy;          int              searchy;
         int              searcho;          int              searcho;
Line 1170 
Line 1172 
         struct screen                   *s = data->backing, ss;          struct screen                   *s = data->backing, ss;
         struct screen_write_ctx          ctx;          struct screen_write_ctx          ctx;
         struct grid                     *gd = s->grid;          struct grid                     *gd = s->grid;
         int                              found, cis;          int                              found, cis, which = -1;
         u_int                            px, py, b, nfound = 0, width;          u_int                            px, py, b, nfound = 0, width;
   
         if (ssp == NULL) {          if (ssp == NULL) {
Line 1196 
Line 1198 
                             px, gd->sx, cis);                              px, gd->sx, cis);
                         if (!found)                          if (!found)
                                 break;                                  break;
   
                         nfound++;                          nfound++;
                           if (px == data->cx && py == gd->hsize + data->cy - data->oy)
                                   which = nfound;
   
                         b = (py * gd->sx) + px;                          b = (py * gd->sx) + px;
                         bit_nset(data->searchmark, b, b + width - 1);                          bit_nset(data->searchmark, b, b + width - 1);
Line 1205 
Line 1210 
                 }                  }
         }          }
   
           if (which != -1)
                   data->searchthis = 1 + nfound - which;
           else
                   data->searchthis = -1;
           data->searchcount = nfound;
   
         if (ssp == &ss)          if (ssp == &ss)
                 screen_free(&ss);                  screen_free(&ss);
         return (nfound);          return (nfound);
Line 1262 
Line 1273 
         gc.flags |= GRID_FLAG_NOPALETTE;          gc.flags |= GRID_FLAG_NOPALETTE;
   
         if (py == 0) {          if (py == 0) {
                 size = xsnprintf(hdr, sizeof hdr,                  if (data->searchmark == NULL) {
                     "[%u/%u]", data->oy, screen_hsize(data->backing));                          size = xsnprintf(hdr, sizeof hdr,
                               "[%u/%u]", data->oy, screen_hsize(data->backing));
                   } else {
                           if (data->searchthis == -1) {
                                   size = xsnprintf(hdr, sizeof hdr,
                                       "(%u results) [%d/%u]", data->searchcount,
                                       data->oy, screen_hsize(data->backing));
                           } else {
                                   size = xsnprintf(hdr, sizeof hdr,
                                       "(%u/%u results) [%d/%u]", data->searchthis,
                                       data->searchcount, data->oy,
                                       screen_hsize(data->backing));
                           }
                   }
                 if (size > screen_size_x(s))                  if (size > screen_size_x(s))
                         size = screen_size_x(s);                          size = screen_size_x(s);
                 screen_write_cursormove(ctx, screen_size_x(s) - size, 0);                  screen_write_cursormove(ctx, screen_size_x(s) - size, 0);

Legend:
Removed from v.1.169  
changed lines
  Added in v.1.170