Changeset 4d4f0ba
- Timestamp:
- Jul 20, 2011, 4:39:33 PM (14 years ago)
- Children:
- ac919d96
- Parents:
- d8f22b6
- git-author:
- Jason Gross <jgross@mit.edu> (07/20/11 03:09:43)
- git-committer:
- Jason Gross <jgross@mit.edu> (07/20/11 16:39:33)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cmd.c
rce68f23 r4d4f0ba 260 260 if (cmd->usage && *cmd->usage) { 261 261 s = cmd->usage; 262 indent = owl_text_indent(s, OWL_TAB );262 indent = owl_text_indent(s, OWL_TAB, true); 263 263 owl_fmtext_append_bold(fm, "\nSYNOPSIS\n"); 264 264 owl_fmtext_append_normal(fm, indent); … … 274 274 if (cmd->description && *cmd->description) { 275 275 s = cmd->description; 276 indent = owl_text_indent(s, OWL_TAB );276 indent = owl_text_indent(s, OWL_TAB, true); 277 277 owl_fmtext_append_bold(fm, "\nDESCRIPTION\n"); 278 278 owl_fmtext_append_normal(fm, indent); -
style.c
rfa180a3 r4d4f0ba 65 65 66 66 /* indent and ensure ends with a newline */ 67 indent = owl_text_indent(body, OWL_TAB );67 indent = owl_text_indent(body, OWL_TAB, true); 68 68 curlen = strlen(indent); 69 69 if (curlen == 0 || indent[curlen-1] != '\n') { -
text.c
r6829afc r4d4f0ba 7 7 /* Returns a copy of 'in' with each line indented 'n' 8 8 * characters. Result must be freed with g_free. */ 9 CALLER_OWN char *owl_text_indent(const char *in, int n )9 CALLER_OWN char *owl_text_indent(const char *in, int n, bool indent_first_line) 10 10 { 11 11 const char *ptr1, *ptr2, *last; 12 12 GString *out = g_string_new(""); 13 13 int i; 14 bool indent_this_line = indent_first_line; 14 15 15 16 last=in+strlen(in)-1; 16 17 ptr1=in; 17 18 while (ptr1<=last) { 18 for (i=0; i<n; i++) { 19 g_string_append_c(out, ' '); 20 } 19 if (indent_this_line) { 20 for (i = 0; i < n; i++) { 21 g_string_append_c(out, ' '); 22 } 23 } 24 indent_this_line = true; 21 25 ptr2=strchr(ptr1, '\n'); 22 26 if (!ptr2) {
Note: See TracChangeset
for help on using the changeset viewer.