[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.45 and 1.46

version 1.45, 2009/10/12 16:41:02 version 1.46, 2009/10/12 17:19:47
Line 327 
Line 327 
                 if (tty->term->flags & TERM_EARLYWRAP)                  if (tty->term->flags & TERM_EARLYWRAP)
                         sx--;                          sx--;
   
                 if (tty->cx == sx) {                  if (tty->cx >= sx) {
                         tty->cx = 0;                          tty->cx = 1;
                         tty->cy++;                          if (tty->cy != tty->rlower)
                                   tty->cy++;
                 } else                  } else
                         tty->cx++;                          tty->cx++;
         }          }
Line 440 
Line 441 
 tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int ox, u_int oy)  tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int ox, u_int oy)
 {  {
         const struct grid_cell  *gc;          const struct grid_cell  *gc;
           struct grid_line        *gl;
         struct grid_cell         tmpgc;          struct grid_cell         tmpgc;
         const struct grid_utf8  *gu;          const struct grid_utf8  *gu;
         u_int                    i, sx;          u_int                    i, sx;
Line 452 
Line 454 
         if (sx > tty->sx)          if (sx > tty->sx)
                 sx = tty->sx;                  sx = tty->sx;
   
         tty_cursor(tty, ox, oy + py);          /*
            * Don't move the cursor to the start permission if it will wrap there
            * itself; much the same as the conditions in tty_cmd_cell.
            */
           gl = NULL;
           if (py != 0)
                   gl = &s->grid->linedata[s->grid->hsize + py - 1];
           if (ox != 0 || (gl != NULL && !(gl->flags & GRID_LINE_WRAPPED)) ||
               tty->cy != oy + py - 1 || tty->cx < tty->sx)
                   tty_cursor(tty, ox, oy + py);
   
         for (i = 0; i < sx; i++) {          for (i = 0; i < sx; i++) {
                 gc = grid_view_peek_cell(s->grid, i, py);                  gc = grid_view_peek_cell(s->grid, i, py);
   
Line 827 
Line 839 
 void  void
 tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)  tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)
 {  {
         tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);          struct window_pane      *wp = ctx->wp;
           struct screen           *s = wp->screen;
           struct grid_line        *gl;
           u_int                    wx, wy;
   
           tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
   
           wx = ctx->ocx + wp->xoff;
           wy = ctx->ocy + wp->yoff;
   
           /*
            * If:
            *
            * - the line was wrapped:
            * - the cursor is beyond the edge of the screen,
            * - the desired position is at the left,
            * - and either a) the desired next line is the one below the current
            *   or b) the current line is the bottom of the scroll region,
            *
            * Then just printing the next character will be enough to scroll into
            * place, so don't do an explicit cursor move.
            */
           gl = NULL;
           if (ctx->ocy != 0)
                   gl = &s->grid->linedata[s->grid->hsize + ctx->ocy - 1];
           if (wy == 0 || (gl != NULL && !(gl->flags & GRID_LINE_WRAPPED)) ||
               tty->cx < tty->sx ||        /* not at edge of screen */
               wx != 0 ||                  /* don't want 0 next */
               (wy != tty->cy + 1 && tty->cy != ctx->orlower + wp->yoff))
                   tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
   
         tty_cell(tty, ctx->cell, ctx->utf8);          tty_cell(tty, ctx->cell, ctx->utf8);
 }  }

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46