Changeset 30da473 for style.c


Ignore:
Timestamp:
Aug 2, 2010, 11:38:03 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
e0022d2
Parents:
2b83ad6
git-author:
David Benjamin <davidben@mit.edu> (07/25/10 19:43:08)
git-committer:
David Benjamin <davidben@mit.edu> (08/02/10 23:38:03)
Message:
Expand tabs before applying OWL_TAB

This is a partial fix to #90. Messages with tabs still do not correctly
tab in the default style, if the intent is to begin column counts after
the 4-space indent. But, if the style does give us tabs, BarnOwl should
correctly draw them from the style. Expanding them here both deals with
owl_fmtext_truncate_cols not understanding tabs and tabs getting
confused by the OWL_TAB indent.

A full fix should expand tabs in the style layer, taking markup into
account.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • style.c

    rb585ba2 r30da473  
    4545  char *indent;
    4646  int curlen;
     47  owl_fmtext with_tabs;
    4748
    4849  SV *sv = NULL;
     
    7273  }
    7374
     75  owl_fmtext_init_null(&with_tabs);
    7476  /* fmtext_append.  This needs to change */
    75   owl_fmtext_append_ztext(fm, indent);
     77  owl_fmtext_append_ztext(&with_tabs, indent);
     78  /* Expand tabs, taking the indent into account. Otherwise, tabs from the
     79   * style display incorrectly due to our own indent. */
     80  owl_fmtext_expand_tabs(&with_tabs, fm, OWL_TAB_WIDTH - OWL_TAB);
     81  owl_fmtext_cleanup(&with_tabs);
    7682
    7783  owl_free(indent);
Note: See TracChangeset for help on using the changeset viewer.