[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.213 and 1.214

version 1.213, 2016/11/15 14:08:27 version 1.214, 2016/11/15 15:17:28
Line 55 
Line 55 
   
 static void     tty_region_pane(struct tty *, const struct tty_ctx *, u_int,  static void     tty_region_pane(struct tty *, const struct tty_ctx *, u_int,
                     u_int);                      u_int);
   static void     tty_region(struct tty *, u_int, u_int);
 static void     tty_margin_pane(struct tty *, const struct tty_ctx *);  static void     tty_margin_pane(struct tty *, const struct tty_ctx *);
   static void     tty_margin(struct tty *, u_int, u_int);
 static int      tty_large_region(struct tty *, const struct tty_ctx *);  static int      tty_large_region(struct tty *, const struct tty_ctx *);
 static int      tty_fake_bce(const struct tty *, const struct window_pane *,  static int      tty_fake_bce(const struct tty *, const struct window_pane *,
                     u_int);                      u_int);
Line 73 
Line 75 
 #define tty_use_acs(tty) \  #define tty_use_acs(tty) \
         (tty_term_has((tty)->term, TTYC_ACSC) && !((tty)->flags & TTY_UTF8))          (tty_term_has((tty)->term, TTYC_ACSC) && !((tty)->flags & TTY_UTF8))
 #define tty_use_margin(tty) \  #define tty_use_margin(tty) \
         (0 && (tty)->term_type == TTY_VT420)          ((tty)->term_type == TTY_VT420)
   
 #define tty_pane_full_width(tty, ctx) \  #define tty_pane_full_width(tty, ctx) \
         ((ctx)->xoff == 0 && screen_size_x((ctx)->wp->screen) >= (tty)->sx)          ((ctx)->xoff == 0 && screen_size_x((ctx)->wp->screen) >= (tty)->sx)
Line 153 
Line 155 
          */           */
         if (tty->flags & TTY_STARTED) {          if (tty->flags & TTY_STARTED) {
                 tty_cursor(tty, 0, 0);                  tty_cursor(tty, 0, 0);
                 tty_region(tty, 0, tty->sy - 1);                  tty_region_off(tty);
                 tty_margin(tty, 0, tty->sx - 1);                  tty_margin_off(tty);
         }          }
   
         return (1);          return (1);
Line 696 
Line 698 
         tty->flags |= TTY_NOCURSOR;          tty->flags |= TTY_NOCURSOR;
         tty_update_mode(tty, tty->mode, s);          tty_update_mode(tty, tty->mode, s);
   
           tty_region_off(tty);
           tty_margin_off(tty);
   
         sx = screen_size_x(s);          sx = screen_size_x(s);
         if (sx > s->grid->linedata[s->grid->hsize + py].cellsize)          if (sx > s->grid->linedata[s->grid->hsize + py].cellsize)
                 sx = s->grid->linedata[s->grid->hsize + py].cellsize;                  sx = s->grid->linedata[s->grid->hsize + py].cellsize;
Line 855 
Line 860 
         tty_default_attributes(tty, ctx->wp, ctx->bg);          tty_default_attributes(tty, ctx->wp, ctx->bg);
   
         tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);          tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
         tty_margin_pane(tty, ctx);          tty_margin_off(tty);
         tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);          tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
   
         tty_emulate_repeat(tty, TTYC_IL, TTYC_IL1, ctx->num);          tty_emulate_repeat(tty, TTYC_IL, TTYC_IL1, ctx->num);
Line 875 
Line 880 
         tty_default_attributes(tty, ctx->wp, ctx->bg);          tty_default_attributes(tty, ctx->wp, ctx->bg);
   
         tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);          tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
         tty_margin_pane(tty, ctx);          tty_margin_off(tty);
         tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);          tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
   
         tty_emulate_repeat(tty, TTYC_DL, TTYC_DL1, ctx->num);          tty_emulate_repeat(tty, TTYC_DL, TTYC_DL1, ctx->num);
Line 952 
Line 957 
         tty_attributes(tty, &grid_default_cell, ctx->wp);          tty_attributes(tty, &grid_default_cell, ctx->wp);
   
         tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);          tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
         tty_margin_pane(tty, ctx);          tty_margin_off(tty);
         tty_cursor_pane(tty, ctx, ctx->ocx, ctx->orupper);          tty_cursor_pane(tty, ctx, ctx->ocx, ctx->orupper);
   
         tty_putcode(tty, TTYC_RI);          tty_putcode(tty, TTYC_RI);
Line 981 
Line 986 
          * using margins, don't do anything - the cursor can just be moved           * using margins, don't do anything - the cursor can just be moved
          * to the last cell and wrap naturally.           * to the last cell and wrap naturally.
          */           */
         if (!tty_use_margin(tty) &&          if ((!tty_use_margin(tty) ||
               tty_pane_full_width(tty, ctx)) &&
             ctx->num != 0 &&              ctx->num != 0 &&
             !(tty->term->flags & TERM_EARLYWRAP)) {              !(tty->term->flags & TERM_EARLYWRAP)) {
                 return;                  return;
Line 1015 
Line 1021 
         tty_default_attributes(tty, wp, ctx->bg);          tty_default_attributes(tty, wp, ctx->bg);
   
         tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);          tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);
         tty_margin_pane(tty, ctx);          tty_margin_off(tty);
         tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);          tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
   
         if (tty_pane_full_width(tty, ctx) &&          if (tty_pane_full_width(tty, ctx) &&
Line 1051 
Line 1057 
         tty_attributes(tty, &grid_default_cell, wp);          tty_attributes(tty, &grid_default_cell, wp);
   
         tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);          tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);
         tty_margin_pane(tty, ctx);          tty_margin_off(tty);
         tty_cursor_pane(tty, ctx, 0, 0);          tty_cursor_pane(tty, ctx, 0, 0);
   
         if (tty_pane_full_width(tty, ctx) &&          if (tty_pane_full_width(tty, ctx) &&
Line 1081 
Line 1087 
         tty_default_attributes(tty, wp, ctx->bg);          tty_default_attributes(tty, wp, ctx->bg);
   
         tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);          tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);
         tty_margin_pane(tty, ctx);          tty_margin_off(tty);
         tty_cursor_pane(tty, ctx, 0, 0);          tty_cursor_pane(tty, ctx, 0, 0);
   
         if (tty_pane_full_width(tty, ctx) &&          if (tty_pane_full_width(tty, ctx) &&
Line 1112 
Line 1118 
         tty_attributes(tty, &grid_default_cell, wp);          tty_attributes(tty, &grid_default_cell, wp);
   
         tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);          tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);
         tty_margin_pane(tty, ctx);          tty_margin_off(tty);
   
         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);
Line 1130 
Line 1136 
   
         if (ctx->ocy == ctx->orlower)          if (ctx->ocy == ctx->orlower)
                 tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);                  tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
         tty_margin_pane(tty, ctx);          tty_margin_off(tty);
   
         /* Is the cursor in the very last position? */          /* Is the cursor in the very last position? */
         width = ctx->cell->data.width;          width = ctx->cell->data.width;
Line 1258 
Line 1264 
         memcpy(gc, &grid_default_cell, sizeof *gc);          memcpy(gc, &grid_default_cell, sizeof *gc);
 }  }
   
   /* Turn off margin. */
   void
   tty_region_off(struct tty *tty)
   {
           tty_region(tty, 0, tty->sy - 1);
   }
   
 /* Set region inside pane. */  /* Set region inside pane. */
 static void  static void
 tty_region_pane(struct tty *tty, const struct tty_ctx *ctx, u_int rupper,  tty_region_pane(struct tty *tty, const struct tty_ctx *ctx, u_int rupper,
Line 1267 
Line 1280 
 }  }
   
 /* Set region at absolute position. */  /* Set region at absolute position. */
 void  static void
 tty_region(struct tty *tty, u_int rupper, u_int rlower)  tty_region(struct tty *tty, u_int rupper, u_int rlower)
 {  {
         if (tty->rlower == rlower && tty->rupper == rupper)          if (tty->rlower == rlower && tty->rupper == rupper)
Line 1291 
Line 1304 
         tty_cursor(tty, 0, 0);          tty_cursor(tty, 0, 0);
 }  }
   
   /* Turn off margin. */
   void
   tty_margin_off(struct tty *tty)
   {
           tty_margin(tty, 0, tty->sx - 1);
   }
   
 /* Set margin inside pane. */  /* Set margin inside pane. */
 static void  static void
 tty_margin_pane(struct tty *tty, const struct tty_ctx *ctx)  tty_margin_pane(struct tty *tty, const struct tty_ctx *ctx)
Line 1299 
Line 1319 
 }  }
   
 /* Set margin at absolute position. */  /* Set margin at absolute position. */
 void  static void
 tty_margin(struct tty *tty, u_int rleft, u_int rright)  tty_margin(struct tty *tty, u_int rleft, u_int rright)
 {  {
         char s[64];          char s[64];

Legend:
Removed from v.1.213  
changed lines
  Added in v.1.214