[BACK]Return to mdoc_term.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/mdoc_term.c between version 1.359 and 1.360

version 1.359, 2017/06/01 19:05:37 version 1.360, 2017/06/04 18:50:35
Line 259  terminal_mdoc(void *arg, const struct roff_man *mdoc)
Line 259  terminal_mdoc(void *arg, const struct roff_man *mdoc)
         size_t                   save_defindent;          size_t                   save_defindent;
   
         p = (struct termp *)arg;          p = (struct termp *)arg;
         p->overstep = 0;  
         p->rmargin = p->maxrmargin = p->defrmargin;          p->rmargin = p->maxrmargin = p->defrmargin;
         term_tab_set(p, NULL);          term_tab_set(p, NULL);
         term_tab_set(p, "T");          term_tab_set(p, "T");
Line 765  termp_it_pre(DECL_ARGS)
Line 764  termp_it_pre(DECL_ARGS)
         case LIST_bullet:          case LIST_bullet:
         case LIST_dash:          case LIST_dash:
         case LIST_hyphen:          case LIST_hyphen:
                 /*                  if (n->type == ROFFT_HEAD) {
                  * Weird special case.                          p->flags |= TERMP_NOBREAK | TERMP_HANG;
                  * Some very narrow lists actually hang.                          p->trailspace = 1;
                  */                  } else if (width <= (int)term_len(p, 2))
                 if (width <= (int)term_len(p, 2))                          p->flags |= TERMP_NOPAD;
                         p->flags |= TERMP_HANG;  
                 if (n->type != ROFFT_HEAD)  
                         break;  
                 p->flags |= TERMP_NOBREAK;  
                 p->trailspace = 1;  
                 break;                  break;
         case LIST_hang:          case LIST_hang:
                 if (n->type != ROFFT_HEAD)                  if (n->type != ROFFT_HEAD)
                         break;                          break;
   
                 /*  
                  * This is ugly.  If `-hang' is specified and the body  
                  * is a `Bl' or `Bd', then we want basically to nullify  
                  * the "overstep" effect in term_flushln() and treat  
                  * this as a `-ohang' list instead.  
                  */  
                 if (NULL != n->next &&  
                     NULL != n->next->child &&  
                     (MDOC_Bl == n->next->child->tok ||  
                      MDOC_Bd == n->next->child->tok))  
                         break;  
   
                 p->flags |= TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG;                  p->flags |= TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG;
                 p->trailspace = 1;                  p->trailspace = 1;
                 break;                  break;
Line 803  termp_it_pre(DECL_ARGS)
Line 784  termp_it_pre(DECL_ARGS)
                 p->trailspace = 2;                  p->trailspace = 2;
   
                 if (NULL == n->next || NULL == n->next->child)                  if (NULL == n->next || NULL == n->next->child)
                         p->flags |= TERMP_DANGLE;                          p->flags |= TERMP_HANG;
                 break;                  break;
         case LIST_column:          case LIST_column:
                 if (n->type == ROFFT_HEAD)                  if (n->type == ROFFT_HEAD)
Line 837  termp_it_pre(DECL_ARGS)
Line 818  termp_it_pre(DECL_ARGS)
         p->offset += offset;          p->offset += offset;
   
         switch (type) {          switch (type) {
         case LIST_hang:  
                 /*  
                  * Same stipulation as above, regarding `-hang'.  We  
                  * don't want to recalculate rmargin and offsets when  
                  * using `Bd' or `Bl' within `-hang' overstep lists.  
                  */  
                 if (n->type == ROFFT_HEAD &&  
                     NULL != n->next &&  
                     NULL != n->next->child &&  
                     (MDOC_Bl == n->next->child->tok ||  
                      MDOC_Bd == n->next->child->tok))  
                         break;  
                 /* FALLTHROUGH */  
         case LIST_bullet:          case LIST_bullet:
         case LIST_dash:          case LIST_dash:
         case LIST_enum:          case LIST_enum:
         case LIST_hyphen:          case LIST_hyphen:
           case LIST_hang:
         case LIST_tag:          case LIST_tag:
                 if (n->type == ROFFT_HEAD)                  if (n->type == ROFFT_HEAD)
                         p->rmargin = p->offset + width;                          p->rmargin = p->offset + width;
Line 920  termp_it_pre(DECL_ARGS)
Line 889  termp_it_pre(DECL_ARGS)
         case LIST_column:          case LIST_column:
                 if (n->type == ROFFT_HEAD)                  if (n->type == ROFFT_HEAD)
                         return 0;                          return 0;
                   p->minbl = 0;
                 break;                  break;
         default:          default:
                 break;                  break;
Line 960  termp_it_post(DECL_ARGS)
Line 930  termp_it_post(DECL_ARGS)
          * has munged them in the meanwhile.           * has munged them in the meanwhile.
          */           */
   
         p->flags &= ~(TERMP_NOBREAK | TERMP_BRTRSP | TERMP_BRIND |          p->flags &= ~(TERMP_NOBREAK | TERMP_BRTRSP | TERMP_BRIND | TERMP_HANG);
                         TERMP_DANGLE | TERMP_HANG);  
         p->trailspace = 0;          p->trailspace = 0;
 }  }
   
Line 1381  termp_fn_pre(DECL_ARGS)
Line 1350  termp_fn_pre(DECL_ARGS)
         if (pretty) {          if (pretty) {
                 term_flushln(p);                  term_flushln(p);
                 p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG);                  p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG);
                   p->flags |= TERMP_NOPAD;
                 p->offset = p->rmargin;                  p->offset = p->rmargin;
                 p->rmargin = rmargin;                  p->rmargin = rmargin;
         }          }
Line 1859  termp_fo_pre(DECL_ARGS)
Line 1829  termp_fo_pre(DECL_ARGS)
                         term_flushln(p);                          term_flushln(p);
                         p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND |                          p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND |
                                         TERMP_HANG);                                          TERMP_HANG);
                           p->flags |= TERMP_NOPAD;
                         p->offset = p->rmargin;                          p->offset = p->rmargin;
                         p->rmargin = rmargin;                          p->rmargin = rmargin;
                 }                  }

Legend:
Removed from v.1.359  
changed lines
  Added in v.1.360

CVSweb