Still a toy series (previous discussion [1]) but it's getting close to
something useful.

This introduces three placeholders %<, %> and %<> for
left/right/center align the next placeholder. Any of them can be
followed by '|' to make the next placeholder use up to the Nth column.

It's pretty useful already. You should be able to do multi column
layout on your wiiide terminal. It might even be useful in multi-line
printouts (e.g. we can relayout the commit header)

There are a few things we can improve:

 - utf8-only support does not sound nice (even though I'm
   perfectly happy with it). At some point I think it'll be easier for
   us to declare all internal strings be in utf8 (or ascii in certain
   places), input/output routines are supposed to do the conversion.
   GNOME has gone this way since 2.0.
 - ellipsis to prevent too long text breaking layout
 - specifing "30% of my screen width" would be nice, but it could get
   complicated if users start to demand "30% width, but no less than 30
   columns and no more than 100 columns, and if blah blah"


Nguyễn Thái Ngọc Duy (6):
  pretty: share code between format_decoration and show_decorations
  pretty: split parsing %C into a separate function
  pretty: support %C(auto[,N]) to turn on coloring on next
  utf8.c: move display_mode_esc_sequence_len() for use by other
  utf8.c: add utf8_strnwidth() with the ability to skip ansi sequences
  pretty: support padding placeholders, %< %> and %<>

 Documentation/pretty-formats.txt |   5 +
 log-tree.c                       |  59 ++++++-----
 log-tree.h                       |   3 +
 pretty.c                         | 211 +++++++++++++++++++++++++++++++--------
 t/ |   8 +-
 utf8.c                           |  48 +++++----
 utf8.h                           |   1 +
 7 files changed, 244 insertions(+), 91 deletions(-)


To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to