[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.131 and 1.132

version 1.131, 2012/05/05 18:31:09 version 1.132, 2012/05/05 18:45:55
Line 59 
Line 59 
 #define tty_use_rect(tty) \  #define tty_use_rect(tty) \
         ((tty)->xterm_version > 270)          ((tty)->xterm_version > 270)
   
   #define tty_pane_full_width(tty, ctx) \
           ((ctx)->xoff == 0 && screen_size_x((ctx)->wp->screen) >= (tty)->sx)
   
 void  void
 tty_init(struct tty *tty, int fd, char *term)  tty_init(struct tty *tty, int fd, char *term)
 {  {
Line 781 
Line 784 
 void  void
 tty_cmd_insertline(struct tty *tty, const struct tty_ctx *ctx)  tty_cmd_insertline(struct tty *tty, const struct tty_ctx *ctx)
 {  {
         struct window_pane      *wp = ctx->wp;          if (!tty_pane_full_width(tty, ctx) ||
         struct screen           *s = wp->screen;  
   
         if (ctx->xoff != 0 || screen_size_x(s) < tty->sx ||  
             !tty_term_has(tty->term, TTYC_CSR) ||              !tty_term_has(tty->term, TTYC_CSR) ||
             !tty_term_has(tty->term, TTYC_IL1)) {              !tty_term_has(tty->term, TTYC_IL1)) {
                 tty_redraw_region(tty, ctx);                  tty_redraw_region(tty, ctx);
Line 802 
Line 802 
 void  void
 tty_cmd_deleteline(struct tty *tty, const struct tty_ctx *ctx)  tty_cmd_deleteline(struct tty *tty, const struct tty_ctx *ctx)
 {  {
         struct window_pane      *wp = ctx->wp;          if (!tty_pane_full_width(tty, ctx) ||
         struct screen           *s = wp->screen;  
   
         if (ctx->xoff != 0 || screen_size_x(s) < tty->sx ||  
             !tty_term_has(tty->term, TTYC_CSR) ||              !tty_term_has(tty->term, TTYC_CSR) ||
             !tty_term_has(tty->term, TTYC_DL1)) {              !tty_term_has(tty->term, TTYC_DL1)) {
                 tty_redraw_region(tty, ctx);                  tty_redraw_region(tty, ctx);
Line 831 
Line 828 
   
         tty_cursor_pane(tty, ctx, 0, ctx->ocy);          tty_cursor_pane(tty, ctx, 0, ctx->ocy);
   
         if (ctx->xoff == 0 && screen_size_x(s) >= tty->sx &&          if (tty_pane_full_width(tty, ctx) && 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 = 0; i < screen_size_x(s); i++)                  for (i = 0; i < screen_size_x(s); i++)
Line 851 
Line 847 
   
         tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);          tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
   
         if (ctx->xoff == 0 && screen_size_x(s) >= tty->sx &&          if (tty_pane_full_width(tty, ctx) && 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 = ctx->ocx; i < screen_size_x(s); i++)                  for (i = ctx->ocx; i < screen_size_x(s); i++)
Line 880 
Line 875 
 void  void
 tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx)  tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx)
 {  {
         struct window_pane      *wp = ctx->wp;  
         struct screen           *s = wp->screen;  
   
         if (ctx->ocy != ctx->orupper)          if (ctx->ocy != ctx->orupper)
                 return;                  return;
   
         if (ctx->xoff != 0 || screen_size_x(s) < tty->sx ||          if (!tty_pane_full_width(tty, ctx) ||
             !tty_term_has(tty->term, TTYC_CSR) ||              !tty_term_has(tty->term, TTYC_CSR) ||
             !tty_term_has(tty->term, TTYC_RI)) {              !tty_term_has(tty->term, TTYC_RI)) {
                 tty_redraw_region(tty, ctx);                  tty_redraw_region(tty, ctx);
Line 910 
Line 902 
         if (ctx->ocy != ctx->orlower)          if (ctx->ocy != ctx->orlower)
                 return;                  return;
   
         if (ctx->xoff != 0 || screen_size_x(s) < tty->sx ||          if (!tty_pane_full_width(tty, ctx) ||
             !tty_term_has(tty->term, TTYC_CSR)) {              !tty_term_has(tty->term, TTYC_CSR)) {
                 if (tty_large_region(tty, ctx))                  if (tty_large_region(tty, ctx))
                         wp->flags |= PANE_REDRAW;                          wp->flags |= PANE_REDRAW;
Line 952 
Line 944 
         tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);          tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);
         tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);          tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
   
         if (ctx->xoff == 0 && screen_size_x(s) >= tty->sx &&          if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) {
             tty_term_has(tty->term, TTYC_EL)) {  
                 tty_putcode(tty, TTYC_EL);                  tty_putcode(tty, TTYC_EL);
                 if (ctx->ocy != screen_size_y(s) - 1) {                  if (ctx->ocy != screen_size_y(s) - 1) {
                         tty_cursor_pane(tty, ctx, 0, ctx->ocy + 1);                          tty_cursor_pane(tty, ctx, 0, ctx->ocy + 1);
Line 988 
Line 979 
         tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);          tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);
         tty_cursor_pane(tty, ctx, 0, 0);          tty_cursor_pane(tty, ctx, 0, 0);
   
         if (ctx->xoff == 0 && screen_size_x(s) >= tty->sx &&          if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) {
             tty_term_has(tty->term, TTYC_EL)) {  
                 for (i = 0; i < ctx->ocy; i++) {                  for (i = 0; i < ctx->ocy; i++) {
                         tty_putcode(tty, TTYC_EL);                          tty_putcode(tty, TTYC_EL);
                         tty_emulate_repeat(tty, TTYC_CUD, TTYC_CUD1, 1);                          tty_emulate_repeat(tty, TTYC_CUD, TTYC_CUD1, 1);
Line 1018 
Line 1008 
         tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);          tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);
         tty_cursor_pane(tty, ctx, 0, 0);          tty_cursor_pane(tty, ctx, 0, 0);
   
         if (ctx->xoff == 0 && screen_size_x(s) >= tty->sx &&          if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) {
             tty_term_has(tty->term, TTYC_EL)) {  
                 for (i = 0; i < screen_size_y(s); i++) {                  for (i = 0; i < screen_size_y(s); i++) {
                         tty_putcode(tty, TTYC_EL);                          tty_putcode(tty, TTYC_EL);
                         if (i != screen_size_y(s) - 1) {                          if (i != screen_size_y(s) - 1) {

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