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

Diff for /src/usr.bin/tmux/screen-write.c between version 1.163 and 1.164

version 1.163, 2020/04/16 16:13:56 version 1.164, 2020/04/16 17:24:28
Line 26 
Line 26 
 static void     screen_write_collect_clear(struct screen_write_ctx *, u_int,  static void     screen_write_collect_clear(struct screen_write_ctx *, u_int,
                     u_int);                      u_int);
 static void     screen_write_collect_scroll(struct screen_write_ctx *);  static void     screen_write_collect_scroll(struct screen_write_ctx *);
 static void     screen_write_collect_flush(struct screen_write_ctx *, int);  static void     screen_write_collect_flush(struct screen_write_ctx *, int,
                       const char *);
   
 static int      screen_write_overwrite(struct screen_write_ctx *,  static int      screen_write_overwrite(struct screen_write_ctx *,
                     struct grid_cell *, u_int);                      struct grid_cell *, u_int);
Line 160 
Line 161 
         struct tty_ctx  ttyctx;          struct tty_ctx  ttyctx;
   
         screen_write_collect_end(ctx);          screen_write_collect_end(ctx);
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
   
         log_debug("%s: %u cells (%u written, %u skipped)", __func__,          log_debug("%s: %u cells (%u written, %u skipped)", __func__,
             ctx->cells, ctx->written, ctx->skipped);              ctx->cells, ctx->written, ctx->skipped);
Line 765 
Line 766 
   
         grid_view_insert_cells(s->grid, s->cx, s->cy, nx, bg);          grid_view_insert_cells(s->grid, s->cx, s->cy, nx, bg);
   
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
         ttyctx.num = nx;          ttyctx.num = nx;
         tty_write(tty_cmd_insertcharacter, &ttyctx);          tty_write(tty_cmd_insertcharacter, &ttyctx);
 }  }
Line 793 
Line 794 
   
         grid_view_delete_cells(s->grid, s->cx, s->cy, nx, bg);          grid_view_delete_cells(s->grid, s->cx, s->cy, nx, bg);
   
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
         ttyctx.num = nx;          ttyctx.num = nx;
         tty_write(tty_cmd_deletecharacter, &ttyctx);          tty_write(tty_cmd_deletecharacter, &ttyctx);
 }  }
Line 821 
Line 822 
   
         grid_view_clear(s->grid, s->cx, s->cy, nx, 1, bg);          grid_view_clear(s->grid, s->cx, s->cy, nx, 1, bg);
   
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
         ttyctx.num = nx;          ttyctx.num = nx;
         tty_write(tty_cmd_clearcharacter, &ttyctx);          tty_write(tty_cmd_clearcharacter, &ttyctx);
 }  }
Line 848 
Line 849 
   
                 grid_view_insert_lines(gd, s->cy, ny, bg);                  grid_view_insert_lines(gd, s->cy, ny, bg);
   
                 screen_write_collect_flush(ctx, 0);                  screen_write_collect_flush(ctx, 0, __func__);
                 ttyctx.num = ny;                  ttyctx.num = ny;
                 tty_write(tty_cmd_insertline, &ttyctx);                  tty_write(tty_cmd_insertline, &ttyctx);
                 return;                  return;
Line 867 
Line 868 
         else          else
                 grid_view_insert_lines_region(gd, s->rlower, s->cy, ny, bg);                  grid_view_insert_lines_region(gd, s->rlower, s->cy, ny, bg);
   
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
   
         ttyctx.num = ny;          ttyctx.num = ny;
         tty_write(tty_cmd_insertline, &ttyctx);          tty_write(tty_cmd_insertline, &ttyctx);
 }  }
Line 894 
Line 896 
   
                 grid_view_delete_lines(gd, s->cy, ny, bg);                  grid_view_delete_lines(gd, s->cy, ny, bg);
   
                 screen_write_collect_flush(ctx, 0);                  screen_write_collect_flush(ctx, 0, __func__);
                 ttyctx.num = ny;                  ttyctx.num = ny;
                 tty_write(tty_cmd_deleteline, &ttyctx);                  tty_write(tty_cmd_deleteline, &ttyctx);
                 return;                  return;
Line 913 
Line 915 
         else          else
                 grid_view_delete_lines_region(gd, s->rlower, s->cy, ny, bg);                  grid_view_delete_lines_region(gd, s->rlower, s->cy, ny, bg);
   
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
         ttyctx.num = ny;          ttyctx.num = ny;
         tty_write(tty_cmd_deleteline, &ttyctx);          tty_write(tty_cmd_deleteline, &ttyctx);
 }  }
Line 937 
Line 939 
         grid_view_clear(s->grid, 0, s->cy, sx, 1, bg);          grid_view_clear(s->grid, 0, s->cy, sx, 1, bg);
   
         screen_write_collect_clear(ctx, s->cy, 1);          screen_write_collect_clear(ctx, s->cy, 1);
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
         tty_write(tty_cmd_clearline, &ttyctx);          tty_write(tty_cmd_clearline, &ttyctx);
 }  }
   
Line 961 
Line 963 
   
         if (s->cx == 0)          if (s->cx == 0)
                 screen_write_collect_clear(ctx, s->cy, 1);                  screen_write_collect_clear(ctx, s->cy, 1);
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
         tty_write(tty_cmd_clearendofline, &ttyctx);          tty_write(tty_cmd_clearendofline, &ttyctx);
 }  }
   
Line 983 
Line 985 
   
         if (s->cx > sx - 1)          if (s->cx > sx - 1)
                 screen_write_collect_clear(ctx, s->cy, 1);                  screen_write_collect_clear(ctx, s->cy, 1);
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
         tty_write(tty_cmd_clearstartofline, &ttyctx);          tty_write(tty_cmd_clearstartofline, &ttyctx);
 }  }
   
Line 1024 
Line 1026 
         else if (s->cy > 0)          else if (s->cy > 0)
                 screen_write_set_cursor(ctx, -1, s->cy - 1);                  screen_write_set_cursor(ctx, -1, s->cy - 1);
   
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
         tty_write(tty_cmd_reverseindex, &ttyctx);          tty_write(tty_cmd_reverseindex, &ttyctx);
 }  }
   
Line 1042 
Line 1044 
         if (rupper >= rlower)   /* cannot be one line */          if (rupper >= rlower)   /* cannot be one line */
                 return;                  return;
   
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
   
         /* Cursor moves to top-left. */          /* Cursor moves to top-left. */
         screen_write_set_cursor(ctx, 0, 0);          screen_write_set_cursor(ctx, 0, 0);
Line 1069 
Line 1071 
             s->rupper, s->rlower);              s->rupper, s->rlower);
   
         if (bg != ctx->bg) {          if (bg != ctx->bg) {
                 screen_write_collect_flush(ctx, 1);                  screen_write_collect_flush(ctx, 1, __func__);
                 ctx->bg = bg;                  ctx->bg = bg;
         }          }
   
Line 1095 
Line 1097 
                 lines = s->rlower - s->rupper + 1;                  lines = s->rlower - s->rupper + 1;
   
         if (bg != ctx->bg) {          if (bg != ctx->bg) {
                 screen_write_collect_flush(ctx, 1);                  screen_write_collect_flush(ctx, 1, __func__);
                 ctx->bg = bg;                  ctx->bg = bg;
         }          }
   
Line 1126 
Line 1128 
         for (i = 0; i < lines; i++)          for (i = 0; i < lines; i++)
                 grid_view_scroll_region_down(gd, s->rupper, s->rlower, bg);                  grid_view_scroll_region_down(gd, s->rupper, s->rlower, bg);
   
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
         ttyctx.num = lines;          ttyctx.num = lines;
         tty_write(tty_cmd_scrolldown, &ttyctx);          tty_write(tty_cmd_scrolldown, &ttyctx);
 }  }
Line 1160 
Line 1162 
         }          }
   
         screen_write_collect_clear(ctx, s->cy + 1, sy - (s->cy + 1));          screen_write_collect_clear(ctx, s->cy + 1, sy - (s->cy + 1));
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
         tty_write(tty_cmd_clearendofscreen, &ttyctx);          tty_write(tty_cmd_clearendofscreen, &ttyctx);
 }  }
   
Line 1183 
Line 1185 
                 grid_view_clear(s->grid, 0, s->cy, s->cx + 1, 1, bg);                  grid_view_clear(s->grid, 0, s->cy, s->cx + 1, 1, bg);
   
         screen_write_collect_clear(ctx, 0, s->cy);          screen_write_collect_clear(ctx, 0, s->cy);
         screen_write_collect_flush(ctx, 0);          screen_write_collect_flush(ctx, 0, __func__);
         tty_write(tty_cmd_clearstartofscreen, &ttyctx);          tty_write(tty_cmd_clearstartofscreen, &ttyctx);
 }  }
   
Line 1257 
Line 1259 
   
 /* Flush collected lines. */  /* Flush collected lines. */
 static void  static void
 screen_write_collect_flush(struct screen_write_ctx *ctx, int scroll_only)  screen_write_collect_flush(struct screen_write_ctx *ctx, int scroll_only,
       const char *from)
 {  {
         struct screen                           *s = ctx->s;          struct screen                           *s = ctx->s;
         struct screen_write_collect_item        *ci, *tmp;          struct screen_write_collect_item        *ci, *tmp;
Line 1302 
Line 1305 
         }          }
         s->cx = cx; s->cy = cy;          s->cx = cx; s->cy = cy;
   
         log_debug("%s: flushed %u items (%zu bytes)", __func__, items, written);          log_debug("%s: flushed %u items (%zu bytes) (%s)", __func__, items,
               written, from);
         ctx->written += written;          ctx->written += written;
 }  }
   
Line 1380 
Line 1384 
                 collect = 0;                  collect = 0;
         if (!collect) {          if (!collect) {
                 screen_write_collect_end(ctx);                  screen_write_collect_end(ctx);
                 screen_write_collect_flush(ctx, 0);                  screen_write_collect_flush(ctx, 0, __func__);
                 screen_write_cell(ctx, gc);                  screen_write_cell(ctx, gc);
                 return;                  return;
         }          }
Line 1425 
Line 1429 
   
         /* If the width is zero, combine onto the previous character. */          /* If the width is zero, combine onto the previous character. */
         if (width == 0) {          if (width == 0) {
                 screen_write_collect_flush(ctx, 0);                  screen_write_collect_flush(ctx, 0, __func__);
                 if ((gc = screen_write_combine(ctx, &gc->data, &xx)) != 0) {                  if ((gc = screen_write_combine(ctx, &gc->data, &xx)) != 0) {
                         cx = s->cx; cy = s->cy;                          cx = s->cx; cy = s->cy;
                         screen_write_set_cursor(ctx, xx, s->cy);                          screen_write_set_cursor(ctx, xx, s->cy);
Line 1438 
Line 1442 
         }          }
   
         /* Flush any existing scrolling. */          /* Flush any existing scrolling. */
         screen_write_collect_flush(ctx, 1);          screen_write_collect_flush(ctx, 1, __func__);
   
         /* If this character doesn't fit, ignore it. */          /* If this character doesn't fit, ignore it. */
         if ((~s->mode & MODE_WRAP) &&          if ((~s->mode & MODE_WRAP) &&
Line 1457 
Line 1461 
                 log_debug("%s: wrapped at %u,%u", __func__, s->cx, s->cy);                  log_debug("%s: wrapped at %u,%u", __func__, s->cx, s->cy);
                 screen_write_linefeed(ctx, 1, 8);                  screen_write_linefeed(ctx, 1, 8);
                 screen_write_set_cursor(ctx, 0, -1);                  screen_write_set_cursor(ctx, 0, -1);
                 screen_write_collect_flush(ctx, 1);                  screen_write_collect_flush(ctx, 1, __func__);
         }          }
   
         /* Sanity check cursor position. */          /* Sanity check cursor position. */
Line 1535 
Line 1539 
   
         /* Create space for character in insert mode. */          /* Create space for character in insert mode. */
         if (s->mode & MODE_INSERT) {          if (s->mode & MODE_INSERT) {
                 screen_write_collect_flush(ctx, 0);                  screen_write_collect_flush(ctx, 0, __func__);
                 ttyctx.num = width;                  ttyctx.num = width;
                 tty_write(tty_cmd_insertcharacter, &ttyctx);                  tty_write(tty_cmd_insertcharacter, &ttyctx);
         }          }

Legend:
Removed from v.1.163  
changed lines
  Added in v.1.164