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

Diff for /src/usr.bin/tmux/tty.c between version 1.132 and 1.133

version 1.132, 2012/05/05 18:45:55 version 1.133, 2012/05/22 09:09:16
Line 51 
Line 51 
 void    tty_redraw_region(struct tty *, const struct tty_ctx *);  void    tty_redraw_region(struct tty *, const struct tty_ctx *);
 void    tty_emulate_repeat(  void    tty_emulate_repeat(
             struct tty *, enum tty_code_code, enum tty_code_code, u_int);              struct tty *, enum tty_code_code, enum tty_code_code, u_int);
   void    tty_repeat_space(struct tty *, u_int);
 void    tty_cell(struct tty *,  void    tty_cell(struct tty *,
             const struct grid_cell *, const struct grid_utf8 *);              const struct grid_cell *, const struct grid_utf8 *);
   
Line 546 
Line 547 
         }          }
 }  }
   
   void
   tty_repeat_space(struct tty *tty, u_int n)
   {
           while (n-- > 0)
                   tty_putc(tty, ' ');
   }
   
 /*  /*
  * Is the region large enough to be worth redrawing once later rather than   * Is the region large enough to be worth redrawing once later rather than
  * probably several times now? Currently yes if it is more than 50% of the   * probably several times now? Currently yes if it is more than 50% of the
Line 647 
Line 655 
         if (sx != screen_size_x(s) && ox + screen_size_x(s) >= tty->sx &&          if (sx != screen_size_x(s) && ox + screen_size_x(s) >= tty->sx &&
             tty_term_has(tty->term, TTYC_EL))              tty_term_has(tty->term, TTYC_EL))
                 tty_putcode(tty, TTYC_EL);                  tty_putcode(tty, TTYC_EL);
         else {          else
                 for (i = sx; i < screen_size_x(s); i++)                  tty_repeat_space(tty, screen_size_x(s) - sx);
                         tty_putc(tty, ' ');  
         }  
         tty_update_mode(tty, tty->mode, s);          tty_update_mode(tty, tty->mode, s);
 }  }
   
Line 735 
Line 741 
 {  {
         struct window_pane      *wp = ctx->wp;          struct window_pane      *wp = ctx->wp;
         struct screen           *s = wp->screen;          struct screen           *s = wp->screen;
         u_int                    i;  
   
         if (ctx->xoff != 0 || screen_size_x(s) < tty->sx) {          if (ctx->xoff != 0 || screen_size_x(s) < tty->sx) {
                 tty_draw_line(tty, wp->screen, ctx->ocy, ctx->xoff, ctx->yoff);                  tty_draw_line(tty, wp->screen, ctx->ocy, ctx->xoff, ctx->yoff);
Line 752 
Line 757 
         else if (tty_term_has(tty->term, TTYC_SMIR) &&          else if (tty_term_has(tty->term, TTYC_SMIR) &&
             tty_term_has(tty->term, TTYC_RMIR)) {              tty_term_has(tty->term, TTYC_RMIR)) {
                 tty_putcode(tty, TTYC_SMIR);                  tty_putcode(tty, TTYC_SMIR);
                 for (i = 0; i < ctx->num; i++)                  tty_repeat_space(tty, ctx->num);
                         tty_putc(tty, ' ');  
                 tty_putcode(tty, TTYC_RMIR);                  tty_putcode(tty, TTYC_RMIR);
         } else          } else
                 tty_draw_line(tty, wp->screen, ctx->ocy, ctx->xoff, ctx->yoff);                  tty_draw_line(tty, wp->screen, ctx->ocy, ctx->xoff, ctx->yoff);
Line 822 
Line 826 
 {  {
         struct window_pane      *wp = ctx->wp;          struct window_pane      *wp = ctx->wp;
         struct screen           *s = wp->screen;          struct screen           *s = wp->screen;
         u_int                    i;  
   
         tty_reset(tty);          tty_reset(tty);
   
         tty_cursor_pane(tty, ctx, 0, ctx->ocy);          tty_cursor_pane(tty, ctx, 0, ctx->ocy);
   
         if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) {          if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL))
                 tty_putcode(tty, TTYC_EL);                  tty_putcode(tty, TTYC_EL);
         } else {          else
                 for (i = 0; i < screen_size_x(s); i++)                  tty_repeat_space(tty, screen_size_x(s));
                         tty_putc(tty, ' ');  
         }  
 }  }
   
 void  void
Line 841 
Line 842 
 {  {
         struct window_pane      *wp = ctx->wp;          struct window_pane      *wp = ctx->wp;
         struct screen           *s = wp->screen;          struct screen           *s = wp->screen;
         u_int                    i;  
   
         tty_reset(tty);          tty_reset(tty);
   
Line 849 
Line 849 
   
         if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL))          if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL))
                 tty_putcode(tty, TTYC_EL);                  tty_putcode(tty, TTYC_EL);
         else {          else
                 for (i = ctx->ocx; i < screen_size_x(s); i++)                  tty_repeat_space(tty, screen_size_x(s) - ctx->ocx);
                         tty_putc(tty, ' ');  
         }  
 }  }
   
 void  void
 tty_cmd_clearstartofline(struct tty *tty, const struct tty_ctx *ctx)  tty_cmd_clearstartofline(struct tty *tty, const struct tty_ctx *ctx)
 {  {
         u_int    i;  
   
         tty_reset(tty);          tty_reset(tty);
   
         if (ctx->xoff == 0 && tty_term_has(tty->term, TTYC_EL1)) {          if (ctx->xoff == 0 && tty_term_has(tty->term, TTYC_EL1)) {
Line 867 
Line 863 
                 tty_putcode(tty, TTYC_EL1);                  tty_putcode(tty, TTYC_EL1);
         } else {          } else {
                 tty_cursor_pane(tty, ctx, 0, ctx->ocy);                  tty_cursor_pane(tty, ctx, 0, ctx->ocy);
                 for (i = 0; i < ctx->ocx + 1; i++)                  tty_repeat_space(tty, ctx->ocx + 1);
                         tty_putc(tty, ' ');  
         }          }
 }  }
   
Line 957 
Line 952 
                         }                          }
                 }                  }
         } else {          } else {
                 for (i = ctx->ocx; i < screen_size_x(s); i++)                  tty_repeat_space(tty, screen_size_x(s) - ctx->ocx);
                         tty_putc(tty, ' ');  
                 for (j = ctx->ocy + 1; j < screen_size_y(s); j++) {                  for (j = ctx->ocy + 1; j < screen_size_y(s); j++) {
                         tty_cursor_pane(tty, ctx, 0, j);                          tty_cursor_pane(tty, ctx, 0, j);
                         for (i = 0; i < screen_size_x(s); i++)                          tty_repeat_space(tty, screen_size_x(s));
                                 tty_putc(tty, ' ');  
                 }                  }
         }          }
 }  }
Line 988 
Line 981 
         } else {          } else {
                 for (j = 0; j < ctx->ocy; j++) {                  for (j = 0; j < ctx->ocy; j++) {
                         tty_cursor_pane(tty, ctx, 0, j);                          tty_cursor_pane(tty, ctx, 0, j);
                         for (i = 0; i < screen_size_x(s); i++)                          tty_repeat_space(tty, screen_size_x(s));
                                 tty_putc(tty, ' ');  
                 }                  }
         }          }
         for (i = 0; i <= ctx->ocx; i++)          tty_repeat_space(tty, ctx->ocx + 1);
                 tty_putc(tty, ' ');  
 }  }
   
 void  void
Line 1019 
Line 1010 
         } else {          } else {
                 for (j = 0; j < screen_size_y(s); j++) {                  for (j = 0; j < screen_size_y(s); j++) {
                         tty_cursor_pane(tty, ctx, 0, j);                          tty_cursor_pane(tty, ctx, 0, j);
                         for (i = 0; i < screen_size_x(s); i++)                          tty_repeat_space(tty, screen_size_x(s));
                                 tty_putc(tty, ' ');  
                 }                  }
         }          }
 }  }

Legend:
Removed from v.1.132  
changed lines
  Added in v.1.133