Changeset 092806c


Ignore:
Timestamp:
Jul 22, 2011, 2:56:26 AM (13 years ago)
Author:
GitHub Merge Button <merge-button@github.com>
Parents:
6500907 (diff), e736dcb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge e736dcbe0f115b53809df6d099b183a245c540d8 into 6500907f6e410b9b8ffb57962f97795ebeb0ccd5
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • editwin.c

    r6829afc re736dcb  
    11511151{
    11521152  oe_excursion x;
    1153   gunichar ch;
     1153  gunichar ch = 0;
     1154  gunichar last_ch;
    11541155  int sentence;
    11551156
     
    11841185    }
    11851186
     1187    last_ch = ch;
    11861188    ch = owl_editwin_get_char_at_point(e);
    11871189
     
    12011203    }
    12021204
    1203     if(ch == '.' || ch == '!' || ch == '?')
     1205    if (ch == '.' || ch == '!' || ch == '?' ||
     1206        (ch == '"' && (last_ch == '.' || last_ch == '!' || last_ch == '?')))
    12041207      sentence = 1;
    12051208    else
  • cmd.c

    rce68f23 r14be3a5  
    260260  if (cmd->usage && *cmd->usage) {
    261261    s = cmd->usage;
    262     indent = owl_text_indent(s, OWL_TAB);
     262    indent = owl_text_indent(s, OWL_TAB, true);
    263263    owl_fmtext_append_bold(fm, "\nSYNOPSIS\n");
    264264    owl_fmtext_append_normal(fm, indent);
     
    274274  if (cmd->description && *cmd->description) {
    275275    s = cmd->description;
    276     indent = owl_text_indent(s, OWL_TAB);
     276    indent = owl_text_indent(s, OWL_TAB, true);
    277277    owl_fmtext_append_bold(fm, "\nDESCRIPTION\n");
    278278    owl_fmtext_append_normal(fm, indent);
  • functions.c

    r837bd81 r6500907  
    14301430#ifdef HAVE_LIBZEPHYR
    14311431    if (owl_message_is_direction_in(m)) {
    1432       char *tmpbuff;
     1432      char *tmpbuff, *tmpbuff2;
    14331433      int i, fields;
    14341434
     
    14761476
    14771477        for (i = 0; i < fields; i++) {
    1478           tmpbuff = owl_zephyr_get_field_as_utf8(n, i + 1);
    1479 
    1480           g_strdelimit(tmpbuff, "\n", '~');
    1481           g_strdelimit(tmpbuff, "\r", '!');
    1482 
    1483           owl_fmtext_appendf_normal(&fm, "  Field %i   : %s\n", i + 1, tmpbuff);
    1484           g_free(tmpbuff);
     1478          tmpbuff = owl_zephyr_get_field_as_utf8(n, i + 1);
     1479          tmpbuff2 = owl_text_indent(tmpbuff, 14, false);
     1480          owl_fmtext_appendf_normal(&fm, "  Field %i   : %s\n", i + 1, tmpbuff2);
     1481          g_free(tmpbuff2);
     1482          g_free(tmpbuff);
    14851483        }
    1486         owl_fmtext_appendf_normal(&fm, "  Default Fm: %s\n", n->z_default_format);
     1484        tmpbuff = owl_text_indent(n->z_default_format, 14, false);
     1485        owl_fmtext_appendf_normal(&fm, "  Default Fm: %s\n", tmpbuff);
     1486        g_free(tmpbuff);
    14871487      }
    14881488
  • message.c

    rdde1b4d r6500907  
    125125    p = m->attributes->pdata[i];
    126126
    127     tmpbuff = g_strdup(owl_pair_get_value(p));
    128     g_strdelimit(tmpbuff, "\n", '~');
    129     g_strdelimit(tmpbuff, "\r", '!');
    130     buff = g_strdup_printf("  %-15.15s: %s\n", owl_pair_get_key(p), tmpbuff);
    131     g_free(tmpbuff);
     127    buff = g_strdup(owl_pair_get_value(p));
     128    if (buff) {
     129      tmpbuff = owl_text_indent(buff, 19, false);
     130      g_free(buff);
     131      buff = g_strdup_printf("  %-15.15s: %s\n", owl_pair_get_key(p), tmpbuff);
     132      g_free(tmpbuff);
     133    }
    132134
    133135    if(buff == NULL) {
  • 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') {
  • text.c

    r6829afc r14be3a5  
    77/* Returns a copy of 'in' with each line indented 'n'
    88 * characters. Result must be freed with g_free. */
    9 CALLER_OWN char *owl_text_indent(const char *in, int n)
     9CALLER_OWN char *owl_text_indent(const char *in, int n, bool indent_first_line)
    1010{
    1111  const char *ptr1, *ptr2, *last;
    1212  GString *out = g_string_new("");
    1313  int i;
     14  bool indent_this_line = indent_first_line;
    1415
    1516  last=in+strlen(in)-1;
    1617  ptr1=in;
    1718  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;
    2125    ptr2=strchr(ptr1, '\n');
    2226    if (!ptr2) {
Note: See TracChangeset for help on using the changeset viewer.