Changeset 14be3a5 for style.c


Ignore:
Timestamp:
Jul 21, 2011, 5:06:19 PM (13 years ago)
Author:
Jason Gross <jgross@mit.edu>
Branches:
master, release-1.10, release-1.9
Children:
6500907
Parents:
d8f22b6
git-author:
Jason Gross <jgross@mit.edu> (07/20/11 03:09:43)
git-committer:
Jason Gross <jgross@mit.edu> (07/21/11 17:06:19)
Message:
Give owl_text_indent an indent_first_line parameter

This is useful if you need to indent text that isn't broken into chunks
that end with newlines.

This is primarily in preparation for the next commit, where we need to
replace the indent on the first line by a prefix.  The other
(reasonable) option is to make owl_text_indent always prefix the string
it's given with an indent, even when it's given the empty string.  This
would break the nice property that indent(A + B) = indent(A) + indent(B)
whenever A ended with a newline.  After some discussion on zephyr and on
the github pull request, I decided to go with this option.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • style.c

    rfa180a3 r14be3a5  
    6565
    6666  /* indent and ensure ends with a newline */
    67   indent = owl_text_indent(body, OWL_TAB);
     67  indent = owl_text_indent(body, OWL_TAB, true);
    6868  curlen = strlen(indent);
    6969  if (curlen == 0 || indent[curlen-1] != '\n') {
Note: See TracChangeset for help on using the changeset viewer.