From 4f61ef03a2f9559d93ce43d5a5a5db86cbf33cd5 Mon Sep 17 00:00:00 2001
From: Kaz Kylheku <kaz@kylheku.com>
Date: Tue, 28 Jul 2015 20:00:26 -0700
Subject: Centered fields in format.

* stream.c (enum align): New enum.
(vformat_align_pre, vformat_align_post): New static functions.
(vformat_num, vformat_str): Argument left renamed to align, and changed
to enum align. vformat_align_pre and vformat_align_post are called to
generate the correct padding for left, center and right alignment.
(vformat): Two-valued local variable left turned into three-valued
align. The ^ prefix on the width field is recognized.

* txr.1: Documented ^ width prefix.
---
 txr.1 | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

(limited to 'txr.1')

diff --git a/txr.1 b/txr.1
index a9e46876..1f05ea20 100644
--- a/txr.1
+++ b/txr.1
@@ -23979,13 +23979,18 @@ are specified as follows:
 .meIP < width
 The width specifier consists of an optional
 .code <
-(left angle bracket) character,
-followed by an optional width specification.
+(left angle bracket) character or
+.code ^
+(caret)
+character followed by an optional width specification.
 
 If the leading
 .code <
 character is present, then the printing will be left-adjusted within
-this field. Otherwise it will be right-adjusted by default.
+this field. If the
+.code ^
+character is present, the printing will be centered within the field.
+Otherwise it will be right-adjusted by default.
 
 The width can be specified as a decimal integer, or as the character
 .codn * .
@@ -23994,10 +23999,12 @@ The
 notation means that instead of digits, the value of the next argument is
 consumed, and expected to be an integer which specifies the width. If that
 integer value is negative, then the field will be left-adjusted.
-If the value is positive, but the
+If the value is positive, but either the
 .code <
-character is present in the width
-specifier, then the field is left adjusted.
+or
+.code ^
+prefix character is present in the width
+specifier, then the field is adjusted according to that character.
 
 .meIP < precision
 The precision specifier is introduced by a leading comma. If this comma appears
-- 
cgit v1.2.3