Changeset 30da473 for fmtext.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
  • fmtext.c

    r2b83ad6 r30da473  
    389389    if (c == '\t') {
    390390      /* Copy up to this tab */
    391       _owl_fmtext_append_fmtext(out, in, numcopied, ptr - in->textbuff - 1);
     391      _owl_fmtext_append_fmtext(out, in, numcopied, ptr - in->textbuff);
    392392      /* and then copy spaces for the tab. */
    393393      chwidth = OWL_TAB_WIDTH - (col % OWL_TAB_WIDTH);
     
    406406  /* Append anything we've missed. */
    407407  if (numcopied < in->textlen)
    408     _owl_fmtext_append_fmtext(out, in, numcopied, in->textlen - 1);
     408    _owl_fmtext_append_fmtext(out, in, numcopied, in->textlen);
    409409}
    410410
Note: See TracChangeset for help on using the changeset viewer.