Skip to content
Commits on Oct 19, 2009
  1. @dscho @gitster

    Add strbuf_add_wrapped_text() to utf8.[ch]

    dscho committed with gitster
    The newly added function can rewrap text according to a given first-line
    indent, other-indent and text width.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  2. @dscho @gitster

    print_wrapped_text(): allow hard newlines

    dscho committed with gitster
    print_wrapped_text() will insert its own newlines. Up until now, if the
    text passed to it contained newlines, they would not be handled properly
    (the wrapping got confused after that).
    
    The strategy is to replace a single new-line with a space, but keep double
    new-lines so that already-wrapped text with empty lines between paragraphs
    will be handled properly.
    
    However, single new-line characters are only handled this way if the
    character after it is an alphanumeric character, as per Linus' suggestion.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Commits on Mar 2, 2007
  1. @dscho

    print_wrapped_text: fix output for negative indent

    dscho committed with Junio C Hamano
    When providing a negative indent, it means that -indent columns were
    already printed. Fix a bug where the function ate the first character
    if already the first word did not fit into the first line.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Feb 28, 2007
  1. @dscho

    Actually make print_wrapped_text() useful

    dscho committed with Junio C Hamano
    Now, it returns the current column, does not add a newline, and you can
    pass a negative indent, to indicate that the indent was already printed.
    
    With this, you can actually continue in the middle of a paragraph, not
    having to print everything into a buffer first.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Dec 24, 2006
  1. @dscho

    commit-tree: encourage UTF-8 commit messages.

    dscho committed with Junio C Hamano
    Introduce is_utf() to check if a text looks like it is encoded
    in UTF-8, utf8_width() to count display width, and implements
    print_wrapped_text() using them.
    
    git-commit-tree warns if the commit message does not minimally
    conform to the UTF-8 encoding when i18n.commitencoding is either
    unset, or set to "utf-8".
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Something went wrong with that request. Please try again.